Today, I will be showing you how to setup a different widget for specific page in WordPress. If you’re familiar with WordPress before, you should notice that WordPress only allow the same widget content for your whole site.
Step #1 Installing the Widget Logic Plugin
We need a plugin called Widget Logic to achieve this. Basically, this plugin lets you control which widget you want to display on each page of your site using short codes.
Download and install it in your WordPress site and activate the plugin once it’s installed.
Step #2 Using the Plugin
Go to Appearance > Widgets to start setup your sidebar.
Assuming that your theme already had a sidebar implemented, add any widget that you wish to add to your sidebar or other widgets holder as you desire. Here, I’m going to add some of my customs menus to show different submenus from every page.
Step #3 Adding the Logic
Once done with adding in the widgets, expand one widget and look at the bottom option called ‘Widget logic’.
Here is where you will add which page this widget will visible. Use below code to add a page and change the text ‘your page name’ to your page or post name.
To add multiple pages, just add ‘||’ between them. For example:
That’s all! It should work now. Go visit your page to see the changes.