Created
November 14, 2015 11:06
-
-
Save Deaner666/121c507d98127f7670b9 to your computer and use it in GitHub Desktop.
Display the details meta field on a WooCommerce product_cat term archive
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
<?php | |
add_action( 'woocommerce_after_shop_loop', 'wpm_product_cat_display_details_meta' ); | |
/** | |
* Display details meta on Product Category archives. | |
* | |
*/ | |
function wpm_product_cat_display_details_meta() { | |
if ( ! is_tax( 'product_cat' ) ) { | |
return; | |
} | |
$t_id = get_queried_object()->term_id; | |
$details = get_term_meta( $t_id, 'details', true ); | |
if ( '' !== $details ) { | |
?> | |
<div class="product-cat-details"> | |
<?php echo apply_filters( 'the_content', wp_kses_post( $details ) ); ?> | |
</div> | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment