OR, how to place related items in this white space?
To move the description to under the product image, try this in functions.php for your child theme:
add_action( 'woocommerce_before_single_product_summary', 'custom_show_description', 60 );
function custom_show_description() {
global $post;
echo '<h3>Description</h3>'.PHP_EOL;
echo the_content();
} // end function
add_filter( 'woocommerce_product_tabs', 'remove_description_tab', 60 );
function remove_description_tab($tabs) {
if ( isset( $tabs['description'] ) ) {
unset( $tabs['description'] );
}
return $tabs;
}
Works for Storefront. Behaviour with other themes may differ.
Thank you @lorro that did move the description, but not where I was intending. Hoping to din something to fill the white space under the product image and to the left of the product options. Any other suggestions to make the layout look better?
That’s what it did on Storefront. Please could you put it back a moment so I can try to debug it.
My test theme has an extra div which makes it possible, but we can add the extra div to your theme in the same way:
add_action( 'woocommerce_before_single_product_summary', 'custom_open_div', 5 );
function custom_open_div() {
echo '<div class="product_page_left_side">'.PHP_EOL;
}
add_action( 'woocommerce_before_single_product_summary', 'custom_show_description', 60 );
function custom_show_description() {
global $post;
echo '<h3>Description</h3>'.PHP_EOL;
echo the_content();
} // end function
add_action( 'woocommerce_before_single_product_summary', 'custom_close_div', 80 );
function custom_close_div() {
echo '</div>'.PHP_EOL;
}
add_filter( 'woocommerce_product_tabs', 'remove_description_tab', 60 );
function remove_description_tab($tabs) {
if ( isset( $tabs['description'] ) ) {
unset( $tabs['description'] );
}
return $tabs;
}
Again, please leave it in if it doesn’t work.
Thank for trying but the custom div line caused an error and gave me a white screen.
Sorry, I don’t know what that could be.
The snippet validates here:
http://phpcodechecker.com/
Please validate the whole contents of your functions.php.
Unfortunately I can’t test it with your theme as I don’t have access to it.
Ok actually, did not mess up the site when I tried again. However, still did not work 🙁
Its getting nearer. Try this custom css:
.single-product .product_page_left_side {
width: 48%;
float:left
}
.woocommerce #content div.product div.images,
.woocommerce div.product div.images,
.woocommerce-page #content div.product div.images,
.woocommerce-page div.product div.images {
width: 100%;
}
THANK YOU! Yes, that worked perfect!
@lorro since you have been a great help can I ask one more question? I changed the above snippet to have the description title be an <h2> tag. This made my Related Products title move to the center and not be left-aligned anymore. Would like it left-aligned. Any suggestions?
Related Products title still pushes to the middle? Thoughts?