WordPress.org

Ready to get started?Download WordPress

Forums

losing pagination (2 posts)

  1. marczaragoza
    Member
    Posted 9 months ago #

    Hi,

    i wanted to show an specific category on the homepage and another category in another place in the site. so i came to this code before the loop in the index page :

    <?php
    if (is_category('5'))
    {
    query_posts('cat=5&showposts='.get_option('posts_per_page'));
    }else{
    query_posts('cat=1&showposts='.get_option('posts_per_page'));
    }
    ?>

    It seems to word but when i try to select the second page it always loads the first page.

    Any help?

    Thanks in advance.

  2. vtxyzzy
    Member
    Posted 8 months ago #

    You need to add the 'paged' parameter to your queries. See this Codex article: https://codex.wordpress.org/Pagination#Adding_the_.22paged.22_parameter_to_a_query

Reply

You must log in to post.

About this Topic