Support » Fixing WordPress » Adding a static welcome message before posts on ‘home’ page?

  • Resolved theindiansabroad


    Could someone tell me what is the best way to achieve this. Right now, I have my home page display posts with newest on top, that is all good. What I want to try is adding a static message at the very top of the home page before the recent posts, and want it to stay at the top. One way I probably can do is by assigning the newest date to this message/post, so that it appears as the most recent post all the time, that means I will have to republish it every time with newer date when I add a post. Not the best thing to do I guess. Could you please guide me as to how I can accomplish this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • if the message always stays the same, edit your theme’s index.php file and add the message before the loop, using HTML

    <?php if (is_front_page()) { ?>
       <p>Display message here</p>
    <?php } ?>

    Could you please also tell me how can I call a long message to insert in your code above instead of ‘display message here’. I have a full paragraph to display along with an image, just like a post.

    Take the code provided, modify the text, follow the instructions provided.

    You’ve been given the solution, now all that’s left is to follow it..

    did you read my follow-up question?


    I just put three words of text in there. You are free to add 2,000 words if you need to. You can have multiple paragraphs, H2 and H3 tags, anything you want, including an image tag, in the space between the two lines of PHP code that presently says
    <p>Display message here</p>

    sorry i didn’t make that clearer originally

    if you don’t already know, the code for an image is – if you have the image in the theme’s images folder:
    <img src="<?php bloginfo('template_directory'); ?>/images/myfilename.jpg" alt="" />
    Change the jpg filename of course


Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Adding a static welcome message before posts on ‘home’ page?’ is closed to new replies.