Add welcome message in wordpress actions

Woocoders
Woocoders
2nd September 2020

To add a welcome message on the homepage:

<?php
function add_welcome_message(){
    if(is_home()) {
        echo '<div class="welcome-text">Welcome message</div>';
    }
};
add_action('themify_content_before', 'add_welcome_message');
?>

Then you need to add this to Theme > Styling > Custom CSS to style the .welcome-message class:

.welcome-text {
    padding: 15px;
    font-size: 120%;
    text-align: center;
}

Share this post: