WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
[resolved] Work on the home page, on the other does not work (4 posts)

  1. Sergej
    Member
    Posted 3 years ago #

    First to say that I tried a lot of options around "query_posts" code modifications, but it seems that I'm not smart enough.

    Here's what it is: pagination works perfectly on the home page, but on the other pages does not work. For example, when in the menu click on my blog - posts are displayed, but when I click on Page 2 (pagination) opens to 404 pages and i get message 'The page you are looking for doesn't exist.'

    Here's my code from theme/index.php:

    <?php
    $frontpage = false;
    if(is_front_page()){
    $frontpage = true;
    query_posts($query_string."&cat=".$lcp_blog_id."&posts_per_page=".$lcp_hp_post_per_page);
    }

    else if(post_is_in_descendant_category($lcp_blog_id))
    {
    query_posts($query_string."&posts_per_page=".$lcp_hp_post_per_page_blog);
    }
    else if(post_is_in_descendant_category($lcp_portfolio_id))
    {
    query_posts($query_string."&posts_per_page=".$lcp_hp_post_per_page_portfolio);
    }
    else if(is_archive())
    {
    query_posts($query_string."&posts_per_page=".$lcp_hp_post_per_page_archive);
    }
    else if( is_search() )
    {
    query_posts($query_string."&posts_per_page=".$lcp_hp_post_per_page_search);
    }

    ?>

    Many thanks in advance for advice and help!

  2. Sergej
    Member
    Posted 3 years ago #

    It does not matter, I resolved the problem.

    Number of posts per page should be equal to the preference for the theme and setting for the entire site.

    Two days I beat my head against the wall, but it seems that there is something in my head :)

    Woah! I am the king, I've removed the problem without help.

  3. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Congratulations :)

  4. hoangc7
    Member
    Posted 3 years ago #

    I have a problem. That is: i want to show a diffrent post_per_page on a achiver page but wp_pagenavi doesn't work correctly, my post_per_page argurment is not effect.
    Who can help me?
    Thank for your help :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic