WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp page numbers not working with query_post (4 posts)

  1. afdownload
    Member
    Posted 4 years ago #

    <?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!

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    <?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(); } ?>
  3. afdownload
    Member
    Posted 4 years ago #

    thamks esmi

    it just worked fine,

  4. azumaya
    Member
    Posted 3 years ago #

    I had the same problem... works just fine! Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.