Hello, I would like to use a custom sidebar for posts of a certain category from a custom post type.
I don’t see a way to do this in the theme panel. When I select a custom sidebar for the categories, this sidebar is only displayed for regular posts, but not for CPT posts. I know that I can also select a custom sidebar for custom post types, but in this case, the sidebar is displayed for all CPT Posts. But I want the sidebar to be displayed only for CPT posts of a specific category. Is there a way to do this?
Hello,
You need to create a different cloud template for cpt for you want to have the sidebar or duplicate the current template and after creating the sidebar like in this guide. https://forum.tagdiv.com/sidebars-tutorial/
Thank you!
ok I chose a blank template for my custom post type single. I can create a custom sidebar there, all fine, but the problem is, it will affect the Custom Post Type in general. That’s not what I want, as I initially said. I want the sidebar to be displayed only for CPT posts of a specific category.
Let’s say I have category A and category B. When I open a CPT post of category A, sidebar X shows up. When I open a CPT post of category B, sidebar Y shows up. That’s what I try to do.
-
This reply was modified 2 years by
rotatio.
Hi,
You can duplicate a cloud template. Please check that you don’t set the template globally. Please select the template you want globally and where you want to have the sidebar assign it individually, not globally.
Also, your CPTs are here -> https://i.imgur.com/ymgp576.png so you can assign the template for each taxonomy.
Thank you!
Hi,
You can have different templates, but only for normal categories. You can duplicate the template and make sure that you have assigned that template for each category.
The same steps are for all templates -> https://forum.tagdiv.com/topic/how-to-add-different-sidebare-for-different-posts-with-the-same-category/
Thank you!