WordPress.org

Ready to get started?Download WordPress

Forums

Static content on home page only in 1.5? (11 posts)

  1. tdellaringa
    Member
    Posted 9 years ago #

    Hi, I want to put some static content on my home page ONLY, I'm using 1.5. It seems that the page template (wp-content/themes/default/page.php) controls ALL pages. Is there a way to wrap this in some conditional to make it show up?

    Also, in the admin in FireFox and IE the template view shows up below the the navigation on the right side, be nice if this could be fixed.

  2. ifelse
    Member
    Posted 9 years ago #

    That's incorrect. Actually, home.php is higher in the template hierachy so if you want a static homepage, just add your code in wp-content/themes/YOUR_THEME/home.php

  3. tdellaringa
    Member
    Posted 9 years ago #

    My theme is default at the moment, so...isn't that the same page?

  4. ifelse
    Member
    Posted 9 years ago #

    Oops, fixed the type. I meant home.php:-) Note that default doesn't currently contain a home.php file.

  5. tdellaringa
    Member
    Posted 9 years ago #

    Ok, not quite following you because there are only two themes installed with 1.5 - default and classic. Neither folder has a home.php. I've not built my own theme yet and I'm not sure I will either - I'll probably just tweak default.

    So do I *add* a page called home.php and the content is picked up? Or am I missing something...

  6. yogaboat
    Member
    Posted 9 years ago #

    If you're asking how to use a static page as your home page (instead of the default blog homepage) this might help:

    http://codex.wordpress.org/Pages#Using_a_Page_as_the_Front_Page

  7. tdellaringa
    Member
    Posted 9 years ago #

    No, that's not what I'm asking actually. The default home page is just fine, but I want to put a *static piece of content* on that page. But page.php handles ALL pages seemingly. If I put it on that page it will show up on EVERY page, which I do not want.

  8. moshu
    Member
    Posted 9 years ago #

    Put your text before the loop in the index.php file.
    Warning: if you don't have single.php, archives.php etc. it will appear in all instances when index.php is called to display content (see Template Hierarchy in Codex > http://codex.wordpress.org/Template_Hierarchy )

  9. tdellaringa
    Member
    Posted 9 years ago #

    Hmm...what loop? In the index.php file, the only code is:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    ?>

    nothing else...

  10. moshu
    Member
    Posted 9 years ago #

    I meant in the index.php file of the THEME that you are using :)
    (wp-content/themes/deafult/index.php)

  11. tdellaringa
    Member
    Posted 9 years ago #

    Nevermind I got it - you meant index.php in my THEME folder. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.