WordPress.org

Ready to get started?Download WordPress

Forums

Category archive as homepage (2 posts)

  1. MultiformeIngegno
    Member
    Posted 1 year ago #

    I want to have a category archive as home page.

    My dirty solution (and it works) now is:

    <?php
    /*
    Template Name: Home Page
    */
    ?>
    <?php
    $homepage = file_get_contents('http://website/category/cat_name/');
    echo $homepage;
    ?>

    as a custom template, select it on a page and set that page as homepage.

    The only downside (other than a greater load on the server caused by the file_get_contents function) is that the admin bar doesn't show up on home page anymore..

    Don't tell me to use wp_query directly on the custom template, I want to set just the category archive itself, is this possible?

    Thanks in advance. :)

  2. keesiemeijer
    moderator
    Posted 1 year ago #

    Don't tell me to use wp_query directly on the custom template, ...

    Seems to me query_posts or new WP_Query() would do what you want. Why don't you want to do it that way?

    http://codex.wordpress.org/Function_Reference/query_posts
    http://codex.wordpress.org/Function_Reference/WP_Query

Topic Closed

This topic has been closed to new replies.

About this Topic