Forums

Issue showing all posts from specific category (4 posts)

  1. sarahfrantz
    Member
    Posted 6 months ago #

    Ugh, first off, this is an older installation of wordpress, so maybe my issue is that I'm used to using the newest version - regardless. I'm having an issue showing all posts from specific categories. I'm suing the query on a page with tabs, each tab is a new query for that category. (here is the link).

    I'm pretty frustrated with this whole operation, but I know its probably simple. Any help would be greatly appreciated =)

    Here's the query I'm using to call the category posts:

    <?php $recent = new WP_Query(); ?>
    			<?php $recent->query('cat=10'); ?>
    			<?php while($recent->have_posts()) : $recent->the_post(); ?>
  2. sarahfrantz
    Member
    Posted 6 months ago #

    I should clarify a little, it shows only a certain amount before stopping. There are 94 posts in the "All Items" category, and I only get so many..

  3. alchymyth
    The Sweeper
    Posted 6 months ago #

    try and add 'posts_per_page' to the query; http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters

    for example:

    <?php $recent = new WP_Query(); ?>
    			<?php $recent->query('cat=10&posts_per_page=-1'); ?>
    			<?php while($recent->have_posts()) : $recent->the_post(); ?>
  4. sarahfrantz
    Member
    Posted 6 months ago #

    Thank you! That seems to have done the trick. I really appreciate your help.

Reply

You must log in to post.

About this Topic