views:

66

answers:

1

Hi,

I have a "static" page set up as my front page for Wordpress.

I have this in the index.php file:

        <?php
        if (is_front_page() || is_home()) {
        ?><p>TEST FRONT PAGE</p>
        <?php
        } ?>

For some reason, the "TEST FRONT PAGE" does not show up on the front page, but does show up on the posts page (as it should, for these purposes only)...I'm using Wordpress 3.0, and I tested this on the twentyten template itself!

Anyone know why?

Thanks, Amit

+1  A: 

Because the front page is loading from front-page.php not index.php.

EDIT

It's loading from page.php. You can read more about the template hierarchy here:

http://codex.wordpress.org/Template_Hierarchy

John P Bloch
OHHHH...Wow thank you!
Amit
No problem. I added a link that explains all the template hierarchy in WordPress. You might find it useful.
John P Bloch
Much appreciated.
Amit
Small correction, the front page is loading from home.php, if present.
windyjonas
Incorrect. home.php loads for the default blog posts view. front-page.php (new in WordPress 3.0) is the front page if you have a static page as home. The terminology is confusing, but home.php will never ever load a static page (unless the file modifies the default query).
John P Bloch