WordPress.org

Support

Support » Themes and Templates » [Resolved] wp page numbers not working with query_post

[Resolved] wp page numbers not working with query_post

  • <?php query_posts('category_name=software'); ?>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<?php the_title(); ?>
    	<?php the_content(); ?>
    	<?php endwhile; else: ?><?php endif; ?>
    	<?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>

    dear guys,
    i have set my homepage to show from an specific category using query_posts but the problem is that it does not redirect to other pages, for example page2 shows same page 1 after using category in my theme
    please show me a way to do so!

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    @esmi

    Forum Moderator

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('category_name=software&paged=' . $paged);
    ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_title(); ?>
    <?php the_content(); ?>
    <?php endwhile; else: ?><?php endif; ?>
    <?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>

    thamks esmi

    it just worked fine,

    I had the same problem… works just fine! Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] wp page numbers not working with query_post’ is closed to new replies.