WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Use next_posts_link & previous_posts_link with a modified loop (3 posts)

  1. grosbouff
    Member
    Posted 6 years ago #

    Hello, I have a modified loop that looks, for example, like this :

    query_posts("cat="5,24");

    How can I use pagination with this ? The next_posts_link & previous_posts_link don't work... I think it is because i'm not in a single category.

  2. Kafkaesqui

    Posted 6 years ago #

  3. grosbouff
    Member
    Posted 6 years ago #

    this is how I did it :

    if (!empty($show_posts_cat)) :
    		$offset = ($paged-1)*$posts_per_page;
    		if ($offset <= 1) {
    			unset($offset);
    		}
    		query_posts("cat=".$show_posts_cat."&offset=".$offset);

Topic Closed

This topic has been closed to new replies.

About this Topic