WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Category archive as home page (6 posts)

  1. MultiformeIngegno
    Member
    Posted 2 years ago #

    Hello. I'm trying to have a certain category archive as my home page.
    I found this code but I don't know where to add it:
    <?php query_posts('cat=X&showposts=X'.get_option('posts_per_page')); ?>

    In loop.php but.. where exactly?

    Thanks in advance!

    P.S.: Child theme of TwentyTen.

  2. Patrick Nommensen
    Member
    Posted 2 years ago #

    Hi !

    Although this might not be the most efficient solution, it should work.

    See this post:

    http://wordpress.org/support/topic/setting-the-homepage-as-a-specific-category-archive?replies=3

  3. MultiformeIngegno
    Member
    Posted 2 years ago #

    Uhm.. I'd like a more "clean" way! ;)

  4. Patrick Nommensen
    Member
    Posted 2 years ago #

    Yeah I figured you would.

    I'm not an expert but I think you would change this:
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    to something like this(this example excludes category 4 posts:

    <?php query_posts('cat=-4'); ?>
    <?php if ( have_posts() ) : while  ( have_posts() ) : the_post(); ?>
  5. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    The easiest way to do this would be to create a loop-index.php file in the child's folder that contained your custom query and a basic Loop.

  6. MultiformeIngegno
    Member
    Posted 2 years ago #

    Thanks! It works now! ;)

Topic Closed

This topic has been closed to new replies.

About this Topic