Grow your CSS skills. Land your dream job.

page navigation with query_post in wordpress

  • # June 30, 2010 at 11:27 am

    I have a template page dedicated to a specific category of posts, and I’m trying to offer page navigation within this page – but it’s not working :? I’m using WP-PageNavi. Here’s what my code looks like:

    Code:
    < ?php
    /*
    Template Name: example page
    */
    ?>
    < ?php get_header(); ?>

    < ?php query_posts('cat=13&showposts=5'); ?>

    < ?php while (have_posts()) : the_post(); ?>

    < ?php if ( get_post_meta($post->ID, ‘Feature Image’, true) ) { ?>

    < ?php } ?>

    < ?php endwhile;?>

    < ?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

    < ?php get_footer(); ?>

    I want to show 5 posts or so on a page, then offer navigation at the bottom. Any ideas what I’m doing wrong here?

    Thanks!

    # August 12, 2010 at 10:59 pm

    Try this <?php query_posts(‘cat=5&showposts=5&paged=’ . $paged); ?> or <?php query_posts("cat=5&showposts=5&paged=$paged"); ?> may this helps you to solve out your problem .

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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