Tagged: is_tax, sidebar, widget area
Taxonomy-only sidebar
-
CreatorTopic
-
May 5, 2014 at 10:25 pm #16767
peak1media
ParticipantHey, I’m trying to add a custom sidebar to my taxonomy archives pages and it won’t appear.
I have a widget area assignment set to is_tax(“juice_category”) http://postimg.org/image/ow1ayu785/
and I added a widget to the widget area http://postimg.org/image/4vip4wr91/
and I made the “widget area location” the “right sidebar” http://postimg.org/image/3osqn7zb9/
and I added in the taxonomy archive template.
Is there anything obvious I missed from the above to get the sidebar to appear?
Thanks!
-
CreatorTopic
-
AuthorReplies
-
May 6, 2014 at 8:20 am #16780
Jason Bobich
KeymasterHello,
Sounds like what you’re doing should work. You want to send over WP login details and I can check it out? You can send the info at My Account > Submit private info here on the support site. Make sure to post back here after the info is sent.
May 6, 2014 at 12:42 pm #16785peak1media
ParticipantHey, I think I tracked it down. I had to modify your themeblvd_fixed_sidebars() function so my taxonomy archives page would show sidebars. Is there any easier way to do that?
function themeblvd_fixed_sidebars( $position ) { $layout = themeblvd_config( 'sidebar_layout' ); // Sidebar Left, Sidebar Right, Double Sidebars if ( $layout == 'sidebar_'.$position || $layout == 'double_sidebar' || get_post_type()=='juice' || is_tax('juice_category')) { ... ... ...
May 6, 2014 at 4:41 pm #16793Jason Bobich
KeymasterYour customization doesn’t quite make sense. If this is what you’re having to do, I think you may be misunderstanding something somewhere else.
These sidebars in this function are displayed based on the current sidebar layout. A sidebar layout is something that is set for every page of your site, no matter what it is — page, post, taxonomy archive, whatever. So the logic of what you’ve changed the condition to doesn’t make sense.
What do you have set for the global Sidebar Layout option at Appearance > Theme Options > Layout > Main?
May 6, 2014 at 4:44 pm #16794peak1media
ParticipantThe “Default Sidebar Layout” is full width, so I’m using the themeblvd_fixed_sidebars() function to override that for is_tax(‘juice_category’).
May 6, 2014 at 5:12 pm #16799Jason Bobich
KeymasterAw, well that explains it all then. If you’ve applied your custom sidebar to the sidebar right location, you need to have the location set to show in the first place. So, what you want to do is apply the correct sidebar layout to your taxonomy page and custom post type.
From your child theme’s functions.php, or your own plugin, you’d just filter themeblvd_sidebar_layout.
http://dev.themeblvd.com/tutorial/sidebar-layouts/#custom
function my_sidebar_layout( $sidebar_layout ) { if( get_post_type() == 'juice' || is_tax('juice_category') ) { $sidebar_layout = 'sidebar_right'; } return $sidebar_layout; } add_filter( 'themeblvd_sidebar_layout', 'my_sidebar_layout' );
May 6, 2014 at 5:40 pm #16802peak1media
ParticipantYes, I knew there was a better way. It works, thank you!
-
AuthorReplies
- You must be logged in to reply to this topic.