Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'woocommerce_archive_description', 'tim_cat_image', 2 );
- function tim_cat_image() {
- if ( is_product_category() ){
- global $wp_query;
- $cate = $wp_query->get_queried_object();
- $thumbnail_id = get_woocommerce_term_meta( $cate->term_id, 'thumbnail_id', true );
- $image = wp_get_attachment_url( $thumbnail_id );
- if ( $image ) {
- echo '<img src="' . $image . '" alt="' . $cate->name . '" />';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement