I was wondering how i might achieve removing the sidebar from the single product page and make the page use the whole container?
ST
Spiracle Themes
Original poster
Member
I was wondering how i might achieve removing the sidebar from the single product page and make the page use the whole container?
Hi Hankgotti,
You need to edit the code. Please follow the steps below
Step 1) First of all you need to go to the theme root folder ie wp-content/themes/krystal-shop
Step 2) Next go to folder template-parts
Step 3) You will find a file content-woocommerce.php there. Open this file in any text editor and replace all the code.
<?php
/**
* Template part for displaying woocommerce content in page.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package krystal-shop
*/
?>
<div class="container">
<div class="row">
<?php
if(is_product()){
?>
<div class="col-md-12">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<div class="woocommerce">
<?php
woocommerce_content();
?>
</div>
</div><!-- .entry-content -->
</article><!-- #post-## -->
</div>
<?php
}
else if("right" === esc_attr(get_theme_mod( 'kr_shop_styles','right' ))) {
?>
<div class="col-md-8">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<div class="woocommerce">
<?php
woocommerce_content();
?>
</div>
</div><!-- .entry-content -->
</article><!-- #post-## -->
</div>
<div class="col-md-3 col-md-offset-1">
<div class="woo-sidebar">
<div class="entry-content">
<div class="woocommerce">
<?php get_sidebar('woosidebar'); ?>
</div>
</div>
</div>
</div>
<?php
}
else if("left" === esc_attr(get_theme_mod( 'kr_shop_styles','right' ))) {
?>
<div class="col-md-3">
<div class="woo-sidebar">
<div class="entry-content">
<div class="woocommerce">
<?php get_sidebar('woosidebar'); ?>
</div>
</div>
</div>
</div>
<div class="col-md-8 col-md-offset-1">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<div class="woocommerce">
<?php
woocommerce_content();
?>
</div>
</div><!-- .entry-content -->
</article><!-- #post-## -->
</div>
<?php
}
else{
?>
<div class="col-md-12">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<div class="woocommerce">
<?php
woocommerce_content();
?>
</div>
</div><!-- .entry-content -->
</article><!-- #post-## -->
</div>
<?php
}
?>
</div>
</div>
Step 4) Save file and refresh your page
Regards
Perfect exactly what i was looking for thanks!