Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1093135
    johankridih
    Participant

    Hi

    I am using stack Integrity, and Woocommerce.

    I have under Apperacen – sidebar created two different sidebars. One for the Shop, and one for the Blog.
    But under X-theme Customizer I can only see the main “Sidebar”. And that is also the only one showing up if I assign it content.

    How can I get my custom sidebars to show up on the pages I want?

    Thank you!

    Johan

    #1093154
    Christopher
    Moderator

    Hi there,

    Sidebars don’t appear in customizer. You should assign sidebar under Appearance -> Sidebars, see the attachment.

    Hope it helps.

    #1093243
    johankridih
    Participant

    I had forgotten those check boxes! Worked great! Thx!

    Johan

    #1093313
    Thai
    Moderator

    If you need anything else please let us know.

    #1192850
    johankridih
    Participant

    Hi, new challenge related to this.

    I have the sidebare for the shop page and the blog archive page. Thats working fine!

    I tag my Blog posts with a category called “Nyheter” (News in norwegian). And I have set in that sidebar setting that I want a sidebar on the taxonomy “Nyheter”. But it wont show up. I have made a sidebar also for the Woocommerce pages where this method does work. So it workes on page, just not blog posts.

    Am I missing something?

    Thanks!

    Johan

    #1193424
    Paul R
    Moderator

    Hi Johan,

    By checking “Nyheter”, it means it will activate the sidebar on Nyheter archive page but not on all posts that is under Nyheter.

    You need to check the posts individually in your sidebar options.

    For a workaround, you can try adding this in your child theme’s functions.php file(wp-content/themes/x-child/functions.php)

    
    add_filter( 'ups_sidebar', 'fix_category_sidebar' );
    
    function fix_category_sidebar($default_sidebar ) {
         $categories = get_the_category();
         $post_categories = array();
         if(is_array($categories)) {
         foreach ( $categories as $category ) {
              $post_categories[] = $category->term_id;
         }
         }
         
         $sidebars   = get_option( 'ups_sidebars' );
         if(is_array($sidebars)){
         foreach ( $sidebars as $id => $sidebar ) {    
                if(isset($sidebar['taxonomies']) && is_array($sidebar['taxonomies'])){         
                 foreach($sidebar['taxonomies'] as $t_id => $tax) {
                     if(in_array($t_id,$post_categories)) {
                         return $id;
                     }
                 }               
                 }           
         }
         }
        return $default_sidebar ;
    }
    

    Hope that helps.

    #1193882
    johankridih
    Participant

    That worked!!

    Dont know how, but it works!

    Thank you!

    #1193961
    Thai
    Moderator

    Glad it worked 🙂

    If you need anything else please let us know.

  • <script> jQuery(function($){ $("#no-reply-1093135 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>