Display Home Welcome Widget Sitewide

If your theme includes a home welcome widget, you may want to display that content side wide rather than just on the home page.

The Agency theme by StudioPress includes one which this code is based on.

Simply add one of these 2 code snippets to the end of your child themes functions.php file.

The only difference between the 2 snippets is the position in which your welcome content display on the page.

Try them both, one at a time, to see which one you prefer.

Styling

There’s no need to add CSS code unless you’re using a theme other than Agency in which case you have 2 options.

Change the class in PHP code from home-welcome to your themes widget class so your widget is styled the same as existing widgets.

Or use it in a new CSS rule with new declarations, in your child themes style.css file.

Note: If you’re using the 2nd code snippet which outputs using the before_content_sidebar_wrap hook, you will need to change the text color as its white for the home page (on a black background) and it will display before your content on all other pages which use a white background.


Comments

2 responses to “Display Home Welcome Widget Sitewide”

  1. Hi Brad, will this work for the executive theme?With thanks, Ken.

    1. Brad Dalton Avatar
      Brad Dalton

      Hello Ken.

      The method will but the code would be different.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.