Grow your CSS skills. Land your dream job.

WordPress query_post loop pagination problems.

  • # December 22, 2012 at 4:11 pm

    Hey all,

    I’m running into difficulties trying to get query_posts to paginate.

    Basically I’m attempting to output only posts that match a tag (on the homepage, tag of “front-page”) or category for the other pages.

    Here is what I have so far;

    < ?php
    if ( get_query_var(‘paged’) ) { $paged = get_query_var(‘paged’); }
    elseif ( get_query_var(‘page’) ) { $paged = get_query_var(‘page’); }
    else { $paged = 1; }
    query_posts( array ( ‘tag’ => ‘front-page’, ‘posts_per_page’ => 5, ‘paged’ => $paged ) ); ?>
    < ?php if ( have_posts() ): while ( have_posts() ) : the_post(); ?>

    ” title=”< ?php the_title(); ?>” rel=”bookmark”>< ?php the_title(); ?>

    ” title=”< ?php the_title(); ?>” class=”button blue”>Read More…
    #disqus_thread”>

    < ?php endwhile; ?>

    < ?php else: ?>

    Nothing Here, Son!

    < ?php endif; ?>
    < ?php wp_reset_query(); ?>

    Any ideas on how I can paginate the above? I’ve tried all sorts of variations but are working properly.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".