Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
Created July 20, 2020 12:26
Show Gist options
  • Save farookibrahim/483d2b373080b7a53d7beb219dfb17fd to your computer and use it in GitHub Desktop.
Save farookibrahim/483d2b373080b7a53d7beb219dfb17fd to your computer and use it in GitHub Desktop.
Electro - Display "Made In:" meta below single product title
if ( ! function_exists( 'el_child_custom_made_in_info' ) ) {
function el_child_custom_made_in_info() {
$made_in_country = get_post_meta( get_the_ID(), 'made_in_country', true );
if( ! empty( $made_in_country ) ) {
?><div class="electro-made-in-country">
<?php echo esc_html__( 'Made in:', 'electro' );?> <span><?php echo esc_html( $made_in_country ); ?></span>
</div><?php
}
}
}
add_action( 'woocommerce_single_product_summary', 'el_child_custom_made_in_info', 10 );
.electro-made-in-country {
display: table-cell;
vertical-align: middle;
color: #8f8e94;
padding-right: 10px;
}
.electro-made-in-country span {
font-weight: 700;
}
@farookibrahim
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment