Home › Forums › General Issues › WooCommerce Display Product Category field in the loop › Reply To: WooCommerce Display Product Category field in the loop
Almost, it put me in the right direction
// Category Extra Title Description in Archives
add_action( ‘woocommerce_after_subcategory_title’, ‘custom_add_product_extratitle’, 12);
function custom_add_product_extratitle ($category) {
$cat_id = $category->term_id;
$prod_term = get_term($cat_id,’product_cat’);
$term = get_field(‘alternative_title’);
$othertitle = get_field(‘alternative_title’, ‘term_’.$prod_term->term_id);
// retrieve the existing value(s) for this meta field.
echo ‘<div class=”extratext”><h2>’.$othertitle.'</h2></div>’;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.