• I’m building a magazine-style blog in which I want the home page to be quite different from interior pages. How do I do this? What files do I need to work with?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Create a home.php for your theme, copy index.php, modify as needed..

    It goes in your theme’s folder, obviously.. 🙂

    Thread Starter pab1953

    (@pab1953)

    Not quite clear …

    – I know how to design pages using HTML and CSS. How much PHP will I need to know to create a “home.php” page?

    – “Copy index.php.” Copy the content of index.php (see below) to home.php?

    – Does my final, newly-minted home page, go in the Theme folder as “home.php” or is it then renamed “index.php”?

    FYI: My Theme’s default index.php code:

    <?php get_header(); ?>
    
    <div id="content" class="clearfix">
    <?php get_sidebar(); ?>
    <div id="left">
    <?php include (TEMPLATEPATH . "/wp-loop.php"); ?>
    
    </div>
    
    </div>
    
    <?php get_footer(); ?>

    You can use whatever template file you want to use as a basis, it was just easy to give the index as example, but yes, you’d be renaming the copied file to home.php …

    Simply put, using a home.php with the theme, allows specific control over what’s seen on the “home” page..

    See here for a visual aid in how WP determines which file to load in given scenarios.
    http://codex.wordpress.org/images/1/18/Template_Hierarchy.png

    FWIW, your home.php could simply contain, if you so choose..

    get_header();
    
    echo 'foo bar';
    
    get_footer();

    or

    echo 'nothing';

    The point being, what’s in this file will only be present when it’s the home page, which is what you originally asked for..

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Make Home Page a Unique Design?’ is closed to new replies.