Created
February 28, 2018 06:11
-
-
Save cargabsj175/a739d35654d2c35be2eca1036b4075e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_after_shop_loop_item_title', 'cj_show_dimensions', 9 ); | |
function cj_show_dimensions() { | |
global $product; | |
$dimensions = $product->get_dimensions(); | |
if ( ! empty( $dimensions ) ) { | |
echo '<p style="font-family: CaviarDreams; color: #b3b3b3; text-transform: uppercase; font-weight: bold;" class="dimensions">' . $dimensions . '</p>'; | |
} | |
} | |
add_shortcode( 'show_dimensions', 'cj_show_dimensions' ); | |
add_action( 'woocommerce_after_shop_loop_item', 'rs_show_weights', 9 ); | |
function rs_show_weights() { | |
global $product; | |
$weight = $product->get_weight(); | |
if ( $product->has_weight() ) { | |
echo '<p style="font-family: CaviarDreams; color: #b3b3b3; text-transform: uppercase; font-weight: bold;" class="product-meta-label">' . $weight . ' ' . get_option('woocommerce_weight_unit') . '</p>'; | |
} | |
} | |
add_shortcode( 'show_weight', 'rs_show_weights' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment