Support » Fixing WordPress » Static text in two languages on top of posts list on home page

  • Resolved dariosorgato


    hi there. I found nearly everything i needed in this forum untill now. i had to surrend and come here and ask.
    I need to put a static text on top of posts in the home page.
    I found a few solutions like WP-sticky or Alert box and similar.
    But this is NOT what I want. I want just a couple of lines underneath the header in a twentyten theme.
    If I use the sticky post than it will have the date, the author name and the ‘share this’ buttons.
    I know nearly nothing of php but I managed to add a text line in index.php but I cannot make it switch the language.
    My website is in 2 languages and I need a different text for each language (english and italian).
    Can you write the code i need to add at the index.php. I suppose underneath the line
    ‘ get_header(); ?> ‘


Viewing 2 replies - 1 through 2 (of 2 total)
  • In other words i need something like a gtext widget to put underneath the header

    I couldn’t wait and i found my own solution.
    It took me a day (or two??? ) but I think I got something interesting

    If you want to add a text just below the header go to header.php and ad the code just before the end.

    <?php if( ( is_home() && !is_paged() )  ) { ?>
    <div id="static" class="clearfloat">
    <?php _e("<!--:it-->
    scrivi qui il testoin italiano
    write here the english text
    <!--:-->"); ?>
    <?php } ?>

    This will pick the text according to the language chosen by the visitor

    Then you can format the new ‘div id static’ in style.css ie:

    #static {
    margin:0 auto;

    bye bye
    Hope this helps someone else

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Static text in two languages on top of posts list on home page’ is closed to new replies.