Forums

navigation problems with custom permalink (1 post)

  1. Marco Tulio
    Member
    Posted 4 months ago #

    Well, I'm using a custom template (blog) where I have a secondary loop and simultaneously I use a custom permalink (Ex: http://liminedesign.com.br/portfolio/) for the query I use this code:

    wp_reset_query();
    $paged = (get_query_var('page')) ? get_query_var('page') : 1;
    $MyQuery = new WP_Query(array('post_type'=> 'post', 'posts_per_page' => $post_in_page, 'paged' => $paged) );
    if ( $MyQuery->have_posts() ) : while ( $MyQuery->have_posts() ) : $MyQuery->the_post();
    ...
    endwhile;
    if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else{
    next_posts_link();
    previous_posts_link();}
    endif;

    [Please post code or markup snippets between backticks or use the code button.]

    but when I select the page 2 or click on next or previous post link I've got a 404 error response;
    I identify that in this construction the function get_query_var('page') always return null, but it works well if I use the same construction with the default permalink (http://liminedesign.com.br/?p=123).
    Can someone tell me if is there a bug with this function or if I'm doing something wrong?
    NOTE: The code does not work neither with the plugin activated neither with the manual navigation links.
    Thank you.

Reply

You must log in to post.

About this Topic

Tags