-
AuthorPosts
-
January 12, 2015 at 1:36 pm #378234
Hi
This one has got me stumped. I have product categories on the home page and I need to add a custom sidebar on those pages however in the categories edit page there is no where to change the sidebar to the custom sidebar.
It seems that changing the “Display Everywhere” widget sidebar will change it on the category page but it also adds it to every other page as well.
Thanks
Richard- This topic was modified 9 years, 10 months ago by Richard.
January 13, 2015 at 5:30 pm #378934Hey Richard!
Open up the /enfold/sidebar.php file and on line 44 you should see this.
if($custom_sidebar)
Add this above it.
if ( is_category( 'test' ) ) { $custom_sidebar = 'mysidebar'; }
And then change “test” with whatever category slug you wish to use and “mysidebar” with a custom widget area you have created.
Cheers!
ElliottJanuary 16, 2015 at 2:43 am #380575Hi Elliott
Thanks for the reply. This is the code I placed in the file but it is not working so I think my interpretation of the widget name is wrong??
if ( is_category( 'large_filters' ) ) { $custom_sidebar = 'text-2'; }
Also won’t this file be overwritten next Enfold update??
Regards
Richard- This reply was modified 9 years, 10 months ago by Richard.
January 16, 2015 at 9:43 pm #381088Hi!
Create a widget area called “special” and use that.
$custom_sidebar = 'special';
You can drag the sidebar.php file to your child theme folder so it’s saved between updates.
Best regards,
ElliottJanuary 20, 2015 at 1:31 am #382219Hi Elliott
Thanks for your reply…I am obviously doing something wrong as it still is not changing the sidebar on the categories page…any ideas?
Regards
RichardJanuary 21, 2015 at 5:25 pm #383149Hi!
Send us a WordPress login and we’ll take a look.
Best regards,
ElliottJanuary 24, 2015 at 1:14 am #384729This reply has been marked as private.January 24, 2015 at 7:59 pm #384964Hey!
That’s actually a product category and not the regular post categories. In this case you have to use “is_product_category”. I went ahead and changed it for you.
Regards,
ElliottJanuary 25, 2015 at 12:20 pm #385078Hi Elliott
Thank you
regards
Richard -
AuthorPosts
- The topic ‘Sidebar Custom’ is closed to new replies.