Make Home Page Widget Appear On All Pages

I saw this question which i think you might find interesting.

I would like to make the Home Top widget to appear on all pages and not just on the home page

Most home page widgets are hard coded into the home.php or front-page.php file of a theme.

This means they will only display on the home or front page.

To get the widget to display on every page, you could remove the code for the widget from the home or front page template file and add it to your functions file.

An easier solution is to hook in a new widget in your functions file and use the same widget i.d.

You will also need to make sure the function name is unique.

No need to register a new widget in this case as you can use the existing home page widget.

Here’s the code you can add to your child themes functions file.

The code includes a conditional tag to exclude the front page as it already includes a widget hard coded into the front-page.php file as you can see in the screenshot below.

front page

Join 5000+ Followers

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