• Hi,

    The pagination was awesome and work well under normal circumstances.
    However, when i try to put in a condition in the main loop(index.php),the pagination will show all post.

    Eg.
    Total i have 100 posts, and i put in a condition checking for post expired by using custom field.When i apply the above,by right there should be 50 posts already expired.And i expecting the pagination show 5 pages instead of 10 pages (using 10 posts per page).But it still came out with 10 pages, after the page 5, it showed no contents/posts.

    Do anyone have any suggestion for the above scenario?
    Appreciate your help and sharing.

    http://wordpress.org/extend/plugins/wp-paginate/

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you are filtering the content after the query, you are going to run into issues with the plugin.

    Can you use a custom query to get the results you want?

    Thread Starter eons

    (@eons)

    Hi emartin,

    I try to use a custom field to filter out the expired posts.Do you have any idea how this can be done using custom query?

    This is how I do it on my site for one of my pages where I only want to show posts in the “project” category:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("category_name=projects&post_status=publish&paged=$paged");

    HTH

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP-Paginate] Display all pages when using conditional in main loop’ is closed to new replies.