WordPress.org

Ready to get started?Download WordPress

Forums

Making the index.php to display posts from a single category. (5 posts)

  1. NewSkool
    Member
    Posted 7 years ago #

    Hi, as you may realise I am not yet very knowledgeble in using WordPress. My probobly very easy question (Althogh I was unable to find out by readin different materials such as the loop action) is: How do I make my main page display posts from just one category? (i.e. I dont want all categories to be displayed on the same page, (unless in search) I want users to see just the posts from the News category when they come to the site)

  2. Chris_K
    Member
    Posted 7 years ago #

    Probably the easiest way I know to do that is to use the Category Visibility plugin.
    http://ryowebsite.com/?p=46

  3. martinhipp
    Member
    Posted 7 years ago #

    Instead of using a plugin, put this in the top of your index.php

    <?php query_posts('category_name=SingleCategory'); ?>

    Replace SingleCategory with the name of the category you want to show.

  4. Chris_K
    Member
    Posted 7 years ago #

    ... and remember to do that each time you change themes, if you go that route.

  5. martinhipp
    Member
    Posted 7 years ago #

    Yeah, what HandySolo said, forgot that

Topic Closed

This topic has been closed to new replies.

About this Topic