WordPress.org

Ready to get started?Download WordPress

Forums

I want to create a category page template for my homepage (3 posts)

  1. wonuks
    Member
    Posted 8 months ago #

    I want to create a category page template to display a post from a particular category on my homepage. More so, I want to make this category page my homepage. Please help me out, I know its possible.

  2. Colin Young
    Member
    Posted 8 months ago #

    Hey wonuks

    If I get what you're asking, once you create your page you could go to Settings | Reading and then choose 'A static page' and select the page.

    The thing with this is that you will have to create a page where your blogs will be shown if you want that.

  3. wonuks
    Member
    Posted 8 months ago #

    Thanks @Collin for the reply.

    I actually want to create a page that can show posts from a particular category. So I created a custom category page template and used that template in creating a page I want to use as the homepage. Visiting the page I created showed the posts from the category but when I made that page my homepage the post didn't appear on the homepage anymore.

    Please I want you to help me. This the code I used for the category page template I created:

    `<?php
    /*
    Template Name: Home page
    */
    get_header();
    ?>
    <div class="content">
    <?php
    query_posts('cat=42');
    while (have_posts()) : the_post();
    the_content();
    endwhile;
    ?>
    </div>
    <?php get_footer(); ?>

Reply

You must log in to post.

About this Topic