• Resolved dshooter

    (@dshooter)


    Hi there,

    I would like to build a wordpress theme that has three main sections for the blog. The three main sections will be accessible via the menu on the menu bar:

    1. section/blog page A – this will display the blog entries for category A only
    2. section/blog page B – this will display the blog entries for category B only
    3. section/blog page C – this will display the blog entries for category C only

    Can someone help me how I can do this?

    Thanks so much.
    dshooter

Viewing 7 replies - 1 through 7 (of 7 total)
  • I think this is what you’re asking for.

    This will make the loop display a certain category and limit how many posts it has:

    <?php query_posts('category_name=PUTITHERE&showposts=1'); ?>

    You’d put that before something like this:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    Where it says PITITHERE, put the name of the category. Where the number 1 is, put the category ID. In Wordpess 2.5, you have to go to manage -> categories, then hover over or copy the link location of the category you want, and the ID is at the end of the URL.

    Check out Category_Templates?

    I was to quick and responded w/slightly the wrong info.

    <?php query_posts('category_name=Uncategorized&showposts=1'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php if ( in_category('1') ) { ?>

    Category_name is the category
    Showposts is how many
    In_category is the category ID

    Hi I have another problem with this. I have 3 pages and 3 categories on the site but how can I identify the category id in these pages as I have only one page template. the category id are not the same as the page id. Is there any way to manage the page id or category id.

    Don’t mix Pages and categories. Use the Category Templates linked above.

    yes, but I’d like to insert these categories in to my nav menu. I am not sure but I think only pages can be inserted. And also I’d like to put some introduction on each category rather than using only posts.

    According to your second questions (“some introduction”) you did NOT read the Category Templates article. Go and do it.

    Re: menu – read this why it is considered a bad idea how you want to solve it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to do Different Category Post on Different Blog Page’ is closed to new replies.