WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Static text in two languages on top of posts list on home page (3 posts)

  1. dariosorgato
    Member
    Posted 3 years ago #

    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(); ?> '

    THANK YOU

  2. dariosorgato
    Member
    Posted 3 years ago #

    In other words i need something like a gtext widget to put underneath the header

  3. dariosorgato
    Member
    Posted 3 years ago #

    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
    <!--:-->
    <!--:en-->
    write here the english text
    <!--:-->"); ?>
    </div>
    <?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 {
    background:#ECECEC;
    font-size:1em;
    margin:0 auto;
    padding:10px;
    width:940px;
    }

    bye bye
    Hope this helps someone else
    dario

Topic Closed

This topic has been closed to new replies.

About this Topic