Site logo

Archived topic

Best way to implement conditional sidebar content?

3 replies · Started by John on May 11, 2019

Viewing posts 1–4 of 4

I need to use different content in a sidebar depending on the page being viewed.

Right now, I want to use one set of content for home page, a different set for category archives and a third for single posts.

In the near future we might want to make this more specific, so that the sidebar content would also be different depending on the category of the single post being viewed.

What is the best way to do this?

I have seen people recommending two different plugins: Content Aware Sidebars, Custom Sidebars. I have also done something similar a long time ago using the dynamic_sidebar() function but I don't remember how exactly.

Something like Content Aware Sidebars is the way to go. Doing so without a plugin would be quite complex I believe.

Thanks Tom

No problem :)

This archived topic is closed to new replies.