Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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, 11 months ago by Richard.
    #378934

    Hey 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!
    Elliott

    #380575

    Hi 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, 11 months ago by Richard.
    #381088

    Hi!

    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,
    Elliott

    #382219

    Hi 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
    Richard

    #383149

    Hi!

    Send us a WordPress login and we’ll take a look.

    Best regards,
    Elliott

    #384729
    This reply has been marked as private.
    #384964

    Hey!

    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,
    Elliott

    #385078

    Hi Elliott

    Thank you

    regards
    Richard

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Sidebar Custom’ is closed to new replies.