Display custom homepage text based on domain

The best solution is to add a widget area that all sites have access to use and then add a text widget.

How I handled this since I had one child theme being used was I added a functions.php file and copied a duplicate of the index.php from the parent theme file into the child theme folder.

My base steps were the same as in the solution @toscho posted: https://wordpress.stackexchange.com/a/76975/35677

This made a widgetable area across all the sites and this is what I wanted. An additional note though is to have my widget use the css and custom widgets of the theme i was using took a bit of manipulation. My theme included custom widgets ontop of the defaults with special formatting for the “title” of a widget a “line break” and then the widget “content”.

In my case I was able to get it to act like the themes native widgets with something like:

function welcome() {
    register_sidebar( array(
        'name' => 'Welcome Message',
        'id' => 'welcome',
        'before_widget' => '<div class="widget-top">',
        'after_widget' => '</div>',
        'before_title' => '<h4>',
        'after_title' => '</h4><div class="stripe-line"></div></div><div class="widget-container">',
    ) );
}
add_action('widgets_init', 'welcome');

As you can see I had to do some custom tag ending to get it to work the same.

Leave a Comment