WordPress.org

Ready to get started?Download WordPress

Forums

need help with category pages (6 posts)

  1. Anonymous
    Unregistered
    Posted 6 years ago #

    I'm making a news site at http://www.thenewscrave.com and I want when the user clicks on any given category, it lists all the posts (title only) from that category instead of just going to the most recent story and having a 'next post' link on the bottom. can anyone give me some pointers? :)

  2. Anonymous
    Unregistered
    Posted 6 years ago #

    bump.. can anyone help? :(

  3. iridiax
    Member
    Posted 6 years ago #

    I have this in my category.php to show all post titles in a category in alphabetical order:

    <ul>
    <?php $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); while (have_posts()) : the_post(); ?>
    	<li><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></li>
    	<?php endwhile; ?>
    </ul>
  4. Anonymous
    Unregistered
    Posted 6 years ago #

    ahh thanks. i put it in and it seemed to work, but created some other problems. once i put it in the category.php page, it shows all the post titles at the top, but then shows all the posts in their entirety undernearth the titles. any way to make it so its only the titles showing?

  5. iridiax
    Member
    Posted 6 years ago #

    You need to replace the loop that's already in there. I'd recommend that you backup your category.php before doing this.

    http://codex.wordpress.org/The_Loop

  6. Anonymous
    Unregistered
    Posted 6 years ago #

    thanks iridiax :). greatly appreciated.

    one last question, in the code u sent me, it seems like it can only show a maximum number of 5 posts in the lists, no matter how much higher i raise the number in posts_per_page=-1. any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic