WordPress.org

Support

Support » Plugins and Hacks » How to make a static welcome message at the top of the frontpage

How to make a static welcome message at the top of the frontpage

  • I would like to have a static welcome message at the top of my blogs frontpage. Like a static entery at the top of the page or something like that. Is it possible? How?

    Niels

Viewing 2 replies - 1 through 2 (of 2 total)
  • One way is to put something before The Loop.

    The top of your main index.php will be something like this:
    <?php
    get_header();
    ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    so putting some thing between those will effectively look like a sticky / message:

    <?php
    get_header();
    ?>
    <div id="message">
    Hi, this is a welcome message
    </div>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    and then in the css:
    #message {
    width:300px;
    margin: 0 auto;
    border: 2px solid #ff0000;
    background-color:#ccc;
    color:#00ff00;
    }

    should get somewhere close ?

    If you only want it on the front page add:

    <?php if(is_home()) { ?>

    <?php } ?>

    around the div.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to make a static welcome message at the top of the frontpage’ is closed to new replies.
Skip to toolbar