• 0

Need to Get Custom Post Types to Display Different Sidebar Widgets Based on Taxonomy / Terms


Question

Posted · Report post

What's the best way to get custom post types with different taxonomies/terms to display different widgets in the sidebars?
 
For example, I've created a custom post type for Market Updates with a (hierarchical) taxonomy of Property Types.
 
I've got 3 different Property Types:
  • Detached Homes
  • Townhouses
  • Condominiums
I've created 3 different sidebars using the Sidebar Manager Light plugin: each one named for the above-noted Property Types.
 
I've created 3 different Views using WP Toolset Views for each Property Type.
 
I've added the Views to the sidebars in the WordPress widget area.
 
I'm trying to use the Widgetizer section in the sidebar of each Property Type to display only the same types of properties (i.e., I only want Detached Homes Property Types to display in the sidebar of a Detached Homes custom post type).
 
But it's not happening for me.
 
No matter what, I get the same widgets in the sidebars of different pages (so Detached Homes shows up in the sidebar of Townhouses and Condominiums).
 
I don't seem to be intellectually capable of figuring out how to get specific widgets to show up in the sidebars of specific custom post types (and only in those sidebars).
 
I've tried Widget Logic (the plugin) with conditional tags and have tried custom templates but I can't get it to work and it's doing my head in.
 
The site`s still under development but here`s a link to a page about Detached Homes, in case it helps: http://abbotsfordrealestate.co/market-updates/detached-homes-may-2014/
 
Can anybody tell me what I am missing / doing wrong?
 
Thanks

Share this post


Link to post
Share on other sites

8 answers to this question

  • 0

Posted (edited) · Report post

dawsonbarber I got a little busy yesterday so i wasnt able to post back but i got this to work by using a plugin custom sidebars which you can find  here  . You can see my test pages here on my test site posttype one and posttype two  .

 

http://i.imgur.com/0VELSEQ.png 

 

Plug in was fairly easy to use I didnt run into any issues but thats not to say there aren't any... I didnt really test it out but it does seem to work.

 

 

Edited by Aires

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

bump

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi, I have done this with regular WP pages but never with custom posttypes but I will give this a try and post the results in a couple hrs.

Sent from my Lumia 900 using Tapatalk

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi, I have done this with regular WP pages but never with custom posttypes but I will give this a try and post the results in a couple hrs.

Sent from my Lumia 900 using Tapatalk

 

Thanks very much, Aries.

 

It does seem to be a little tricky with custom post types, especially since I want to exclude certain taxonomy/terms on certain custom post type pages.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

 

This is more of a WordPress question, therefore, you will be better posting this on the WordPress support forums.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

 

This is more of a WordPress question, therefore, you will be better posting this on the WordPress support forums.

 

After rereading my post, I can see that there are three other places that I should have considered raising the issue: Sidebar Manager Light, Widget Logic, WP-Toolset.

 

Dumb question for the DMS customization forum. Sorry for the bother.

 

Cheers

Share this post


Link to post
Share on other sites
  • 0

Posted (edited) · Report post

I will also add that I didnt play around with all the options above.

 

And I use it with the actual sidebar section and not the wigetizer.

 

And it looks like you can go in and change the sidebar location of sidebar created with other plugins like sidebar manager light just open up the sidebar and options will we available to change the location.

 

Hope this helps 

 

Edited by Aires

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi Aries

 

Thanks for this and for taking the time to do this.

 

It looks like the example pages feature the same sidebar/widgets for two different custom post types.

 

I'm trying to get different sidebars/widgets for the same custom post type with different taxonomies/terms.

 

I've tried with the custom sidebar plugin and then again with the sidebar manager lite plugin and with widget logic.

 

I think I may have things sorted now, after I reactivated a different theme framework and removed all custom function edits and every trace of any modification I had done using the other theme framework.

 

I reactivated DMS, did a quick test with widget logic on a widget in the primary sidebar and it worked.

 

So I'm thinking that one of the modifications I had done to the other framework may have left some residue behind that was preventing widget logic from working.

 

Thanks again for your help on this.

 

Cheers

 

Dawson

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now