• Resolved krakt

    (@krakt)


    Hi all,

    I am working on a custom theme from scratch and when I try to customize it for woocommerce I get a strange bug that I do not understand. I try to add some widget on my left and right side of the page and some of them does not show when I put them on the left sidebar. Can someone help me with this pls?

    This is the code I use

    <section class="page-wrap">
        
        <div class="container">
            
            <section class="row">
                
                <?php if(is_active_sidebar('page-left-sidebar')): ?>
    
                    <div class="col-3">
    
                        <?php dynamic_sidebar('page-left-sidebar'); ?>
    
                    </div>
    
                <?php endif; ?>
                
                <?php if(is_active_sidebar('page-left-sidebar') xor is_active_sidebar('page-right-sidebar')): ?>
                <div class="col-9">
                <?php elseif (is_active_sidebar('page-left-sidebar') && is_active_sidebar('page-right-sidebar')): ?>
                <div class="col-6">
                <?php else: ?>
                <div class="col-12">
                <?php endif; ?>
    
                    <h1><?php the_title(); ?></h1>
    
                    <?php get_template_part('includes/section', 'content'); ?>
                </div>
                
                <?php if(is_active_sidebar('page-right-sidebar')): ?>
                    <div class="col-3">
                    
                        <?php dynamic_sidebar('page-right-sidebar'); ?>
    
                    </div>
                <?php endif; ?>
                
            </section>
    
        </div>
    
    </section>

    and this is the result on chrome Version 80.0.3987.106 (Build officiel) (64 bits) but I got the same on FF and Edge

    WooCommerce widget not showing on left sidebar

    Thank you

    • This topic was modified 6 years, 3 months ago by krakt.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Ross V. a11n

    (@rossviviano)

    Automattic Happiness Engineer

    Hi there,

    This is a fairly complex development topic, so I’m going to leave it open for a bit to see if anyone is able to jump in to help you out.

    I can also recommend the following places for more development-oriented questions:

    WooCommerce Slack Community: https://woocommerce.com/community-slack/
    Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    Best,

    Ross

    Thread Starter krakt

    (@krakt)

    Ok thank you for the respond I will try to find a solution and if I found it and the topic is still open I will give the andswer here too and close the topic.

    Thank you again for your time 🙂

    • This reply was modified 6 years, 3 months ago by krakt.
    Thread Starter krakt

    (@krakt)

    I found something, the line 77 on the widget as a test that make the widget not appear if it is on the left of my products. I still need to check what does it really do

    // If there are not posts and we're not filtering, hide the widget.
    if ( ! WC()->query->get_main_query()->post_count && ! isset( $_GET['min_price'] ) && ! isset( $_GET['max_price'] ) ) { // WPCS: input var ok, CSRF ok.
    			return;
    		}
    • This reply was modified 6 years, 3 months ago by krakt.
    Thread Starter krakt

    (@krakt)

    I think i found the real problem, it’s only the fact that I forget to add the “body_class();” to my html body tag!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Left sidebar does not show some widget’ is closed to new replies.