• Resolved digitalhead

    (@digitalhead)


    I’m trying to have a greeting message on my home page, but it shows on all pages. How can I make it only show on the home page? Here’s the code that I put into my index.php:

    <?php if (file_exists(TEMPLATEPATH . '/' . 'greet.html')) : ?>
    <div id="greetcontainer" class="span-22 prepend-1 append-1 last">
    <div id="greet">
    <div id="greettext" class="span-15">
    <?php readgreet('greet.html'); ?>
    </div>
    </div>
    </div>
    <?php endif; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php if (file_exists(TEMPLATEPATH . '/' . 'greet.html') && !is_paged() ) : ?>
    <div id="greetcontainer" class="span-22 prepend-1 append-1 last">
    <div id="greet">
    <div id="greettext" class="span-15">
    <?php readgreet('greet.html'); ?>
    </div>
    </div>
    </div>
    <?php endif; ?>
    Thread Starter digitalhead

    (@digitalhead)

    esmi: Sorry, that doesn’t appear to have worked. I cleared cache to make sure, but it’s still showing up on individual posts.

    Try:

    <?php if (file_exists(TEMPLATEPATH . '/' . 'greet.html') && is_home() && !is_paged() ) : ?>
    <div id="greetcontainer" class="span-22 prepend-1 append-1 last">
    <div id="greet">
    <div id="greettext" class="span-15">
    <?php readgreet('greet.html'); ?>
    </div>
    </div>
    </div>
    <?php endif; ?>
    Thread Starter digitalhead

    (@digitalhead)

    Thanks, that did the trick.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Greeting message only on home page’ is closed to new replies.