WordPress.org

Ready to get started?Download WordPress

Forums

List Post Titles for specific Categories (3 posts)

  1. grrlduda
    Member
    Posted 6 years ago #

    On my blog, i have the titles of my posts listed on the homepage by using the following code:

    <?php get_archives('postbypost', 10); ?>

    But we'd like to split up the displaying of post titles by categories. Maybe just list the most recent 3 or 5 posts by that category.

    I tried using the following on the home.php template and it doesn't work:

    <?php query_posts('cat=1'); ?>
    <?php query_posts('cat=3'); ?>

    I know

    <?php wp_list_categories('sort_column=name&title_li='); ?>
    <?php wp_list_cats('sort_column=name'); ?>

    only list the Category Titles.

    But I need the Post Titles to display for a Specific Category. Still searching for an answer.

    What steps am I missing?

  2. moshu
    Member
    Posted 6 years ago #

    I tried using the following on the home.php template and it doesn't work:

    <?php query_posts('cat=1'); ?>
    <?php query_posts('cat=3'); ?>

    Because that's not enough. That line alone doesn't do anything. You need The_Loop after that and need template tags, like the_title, without the_content.

  3. Dreamsinplay
    Member
    Posted 5 years ago #

    Does this script allow you to have your archieve just show the post titles in a specific category?

    Thanks!!!

    - Andrew

Topic Closed

This topic has been closed to new replies.

About this Topic