Please can you explain how I can override the following code from content-product.php
// Width, Height parameters
if ( $sf_product_multimasonry ) {
$masonry_thumb_size = sf_get_post_meta( get_the_ID(), 'sf_masonry_thumb_size', true );
if ( $masonry_thumb_size == "large" ) {
$classes[] = 'col-sm-6 size-large';
$width = 'col-sm-6';
$thumb_width = 720;
$thumb_height = 578;
} else if ( $masonry_thumb_size == "tall" ) {
$classes[] = 'col-sm-3 size-tall';
$width = 'col-sm-3';
$thumb_width = 360;
$thumb_height = 578;
} else {
$classes[] = 'col-sm-3 size-standard';
$width = 'col-sm-3';
$thumb_width = 360;
$thumb_height = 289;
}
} else {
if ( $product_layout == "grid" ) {
if ( $sidebar_config == "no-sidebars" ) {
$classes[] = 'col-sm-sf-5';
$width = 'col-sm-sf-5';
} else {
$classes[] = 'col-sm-3';
$width = 'col-sm-3';
}
} else if ($woocommerce_loop['columns'] == 4) {
$classes[] = 'col-sm-3';
$width = 'col-sm-3';
} else if ($woocommerce_loop['columns'] == 5) {
$classes[] = 'col-sm-sf-5';
$width = 'col-sm-sf-5';
} else if ($woocommerce_loop['columns'] == 3) {
$classes[] = 'col-sm-4';
$width = 'col-sm-4';
} else if ($woocommerce_loop['columns'] == 2) {
$classes[] = 'col-sm-6';
$width = 'col-sm-6';
} else if ($woocommerce_loop['columns'] == 1) {
$classes[] = 'col-sm-12';
$width = 'col-sm-12';
} else if ($woocommerce_loop['columns'] == 6) {
$classes[] = 'col-sm-2';
$width = 'col-sm-2';
}
In the child theme folder I’ve tried 2 methods – creating /woocommerce/content-product.php, and also adding the above code to funtions.php. Neither work. I’d be grateful for some help.