Fixed Text on Main Page

Community Forums Forums Design Tips and Tricks Fixed Text on Main Page

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  incomeclub 1 year, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9023

    incomeclub
    Participant
    Post count: 7

    Is it possible for me to add a block of static text that will be displayed before my first post on the main page only?

    If so, can you provide me with a sample?  I would like for it to be above the breadcrumb section on the home page only.

    • This topic was modified 1 year, 7 months ago by  incomeclub.
    • This topic was modified 1 year, 7 months ago by  incomeclub.
    #9028

    Chris Cree
    Participant
    Post count: 147

    Adding something along these lines to your functions.php file should do the trick.
    [php]add_action( ‘genesis_before_content’, ‘child_add_home_welcome_text’ );
    function child_add_home_welcome_text() {
    if ( is_front_page() ) {
    echo ‘<div class="welcome-text">’;
    echo ‘[PLACE YOUR STATIC TEXT HERE]‘;
    echo ‘</div>’;
    }
    }[/php]

    Change out the [PLACE YOUR STATIC TEXT HERE] with your text and then add some css styling to your style sheet for the .welcome-text class as needed.


    #9037

    incomeclub
    Participant
    Post count: 7

    Thank you.  That seems to work out very well.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Fixed Text on Main Page’ is closed to new replies.