WordPress.org

Ready to get started?Download WordPress

Forums

Create static front page for category? (3 posts)

  1. thelaw
    Member
    Posted 4 years ago #

    Is there a way to create a static front page for a category the same way you can do it for the home page? For the home page it seems to be a control in the blog, not sure if there is a plugin or other way to do this so that the front page of a category shows the static page I'd like to show with the text I'd like.

  2. aj3x2
    Member
    Posted 4 years ago #

    Create a mainpage category and place the code below in your
    Main Index Template (index.php),

    <?php if (is_home())
    {
    query_posts("category_name='mainpage'");
    }
    ?>

    Make sure the code is below,
    <?php get_header(); ?>
    <?php get_sidebar(); ?>

    so, it looks like this,

    <?php get_header(); ?>
    <?php get_sidebar(); ?>

    <?php if (is_home())
    {
    query_posts("category_name='mainpage'");
    }
    ?>

    Now everytime your blog loads the default post category that shows will be the mainpage cat. Hope that's what you were looking for, if not, sorry!

  3. thelaw
    Member
    Posted 4 years ago #

    Thanks aj3xs - not what I meant.

    I have three categories - cars, trips and dogs. On the cars category front page, instead of having latest posts on the cars category front page, I want to put up a static page with just specific text on it. On the home page, you can set any static page you have as the home page. I'd like to do the same just for the cars category but not any other.

Topic Closed

This topic has been closed to new replies.

About this Topic