Skip to content

Instantly share code, notes, and snippets.

@Deaner666

Deaner666/functions.php

Last active Aug 29, 2015
Embed
What would you like to do?
Display custom meta on WooCommerce product_cat archive page
<?php
// Display details on product category archive pages
add_action( 'woocommerce_after_shop_loop', 'wpm_product_cat_archive_add_meta' );
function wpm_product_cat_archive_add_meta() {
$t_id = get_queried_object()->term_id;
$term_meta = get_option( "taxonomy_$t_id" );
$term_meta_content = $term_meta['custom_term_meta'];
if ( $term_meta_content != '' ) {
echo '<div class="woo-sc-box normal rounded full">';
echo apply_filters( 'the_content', $term_meta_content );
echo '</div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment