Different sidebar for different website pages

I have a website on WordPress on which I am reviewing products related to portable carpet cleaners. My widget sidebar is same on all over the website, but what I want is to show different sidebars on different pages of my website. Is there any way to do it?

Each page of your wordpress site can have a template associated with it. That template can call on a particular sidebar using the name it was registered with. So for instance your theme can create a sidebar called “ordering_sidebar” and for all ordering pages you would create an “order” template which would call on the sidebar using get_sidebar("ordering_sidebar");

Then maybe another page is an info page with an info sidebar. That page can be associated with an info template that calls get_sidebar("info_sidebar");

I suggest having a quick read through this URL to get a better idea of how you can register a sidebar and then call on each sidebar you want to display. If you do this from a given template and then associate a page with a given template, you can show the same sidebar for any page associated with a given template. Hopefully this makes sense.

https://developer.wordpress.org/themes/functionality/sidebars/ :slight_smile:

1 Like

Perfect, that works.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.