Free and Premium WordPress Plugins & Themes Forums WordPress Themes Emmet WooCommerce +Emmet Pro Add Category Descriptions
- This topic has 2 replies, 2 voices, and was last updated 7 years ago by
Mike Hammock.
Viewing 3 posts - 1 through 3 (of 3 total)
- AuthorPosts
- January 16, 2018 at 7:40 pm #630937
Mike Hammock
ParticipantHi there,
Why does the Emmet Pro theme fail to show the category desriptions on this page? https://lineofduty.com/shop/categories?
Woocommerce says that it depends on the theme – the only reason I am asking is because this is the Emmet Pro Theme.
Is there a “fix” or modification for this issue?
Best Regards,
Mike HJanuary 22, 2018 at 9:12 am #633333J. Davis
KeymasterHi Mike,
Thank you for reaching us out. You can output category description page where are listed categories by adding code below to functions.php file of your child theme.
add_action( 'woocommerce_archive_description', 'woocommerce_category_image', 2 ); function woocommerce_category_image() { if ( is_product_category() ){ global $wp_query; $cat = $wp_query->get_queried_object(); $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); $image = wp_get_attachment_url( $thumbnail_id ); if ( $image ) { echo '<img src="' . $image . '" alt="' . $cat->name . '" />'; } } }
Best regards,
JohnFebruary 11, 2018 at 9:54 pm #643930Mike Hammock
ParticipantOK!
Im going to try that 🙂 - AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.