Support » Fixing WordPress » Unable to remove sidebar from single prodcut page

  • Resolved aeim

    (@aeim)


    Hello,

    We are using the UltraStrap theme for our website and we can’t remove the sidebar from, the single product page. We tried every solution out there and still nothing works, can anyone please assist?
    Thank you

    • This topic was modified 8 months, 2 weeks ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • There is some custom CSS in this thread that may prove helpful in your case

    @harmonyromo thank you but its not working

    @aeim Add the follows code snippet in your active theme’s functions.php –

    function remove_sidebar_single_product_page() {
    if ( is_product() ) {
    // for understrap theme
    remove_action( ‘woocommerce_after_main_content’, ‘understrap_woocommerce_wrapper_end’, 10 );
    // for default woocommerce structure
    remove_action( ‘woocommerce_sidebar’, ‘woocommerce_get_sidebar’, 10 );
    // add wrapper end for single product
    add_action( ‘woocommerce_after_main_content’, ‘understrap_woocommerce_wrapper_end_for_single_product’, 11 );
    }
    }
    add_action( ‘wp’, ‘remove_sidebar_single_product_page’ );

    function understrap_woocommerce_wrapper_end_for_single_product(){
    echo ‘</main><!– #main –>’;
    echo ‘</div><!– .row –>’;
    echo ‘</div><!– Container end –>’;
    echo ‘</div><!– Wrapper end –>’;
    }

    @pixellanguage Thank you for replying.

    We received an error.

    Parse error: syntax error, unexpected ‘/’ in /home2/evkfhumy/public_html/wp-content/themes/ae/functions.php on line 85

    There has been a critical error on your website.

    We got it resolved.

    We found a solution below

    .single-product #sidebar { display: none;}
    .single-product .single_wrap {  width: 100%;}

    It didn’t work because in the code above its “#sidebar”

    See–us silly geese have it “#left-sidebar” so all we had to do was add “left-” in the CSS above.

    Thank you for your help!

    • This reply was modified 8 months, 2 weeks ago by aeim.

    ok great

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unable to remove sidebar from single prodcut page’ is closed to new replies.