get_post_thumbnail return featured image for post. in order to get a thumbnail of the category, you need to fetch it through term meta.
global $wp_query;
$cat = $wp_query->get_queried_object();
$thumbnail_id = get_term_meta( $cat->term_id, 'thumbnail_id', true );
$image = wp_get_attachment_url( $thumbnail_id );
on the product page, since there can be multiple terms for a single product,
you need to fetch terms for that product first and then extract a thumbnail image of a specific term.
Related Posts:
- Display the featured image from the last post
- Random Featured Image Based on Category
- Category images are not displaying in WordPress
- How to add image for all posts associated to specified category?
- How to make product image inherit from category image
- Can I set a default featured image for a category?
- Woocommerce get category image full size
- How can I add the featured image functionality to a custom taxonomy?
- How can I make post fields required in WordPress?
- How to add a background image to category and display image on category page
- Different excerpt styles per category, but chronological
- Display child categories in WooCommerce
- How to make a Thumbnails Mosaic
- Display category name on featured image in wordpress excerpt
- Add Image Size for one Media Category Only
- Extract image url associated to a category
- Retrieve Image from Media Library by it’s category
- Show category images on single product page and product overview page
- Category index featured image
- Link Attachment Image to Category
- Change thumbnail image depending product category
- category image taxonomy
- get_post_meta not working on category.php
- Redirect to another page using contact form 7? [closed]
- Display thumbnails for certain category posts
- why get_the_post_thumbnail( the_ID()) echos extra post id
- How do you use the featured image of the most recent post in a category as the background image
- Need to echo category id in multi-dimensional array
- Category view with contents of [gallery]s shown
- Random category with recent post title and thumbnail
- How to add icon over specific thumb
- Display post thumbnail for specific category outside the loop
- How to hide featured images of all posts falling under the same category in wordpress?
- show thumbnail for subcategory wordpress
- How to display categories image in loop homepage WordPress
- Change background image page header overlay for each category
- Image Upload Custom Form Field for Category and Custom Taxonomy
- How to hide/remove featured images in particular categories post?
- Icon images across multiple categories
- How to show category image if no featured image is set?
- Media Categories as Classes on WordPress Gallery Shortcode
- How to relocate images
- Custom field picture instead of post thumbnail on category page
- In a shared site, how to get products in a category from one site to another?
- Display one post on category.php: Wrong featured image
- How to enable admins/editors to set a featured image for specific category?
- Category page with gallery for each post
- Retrieve post thumbnails
- Image menu showing categories in page
- Featured image for links and categories
- Get all first images of posts in same category
- Show thumbnails 1-12 of category x on any given page
- Add category image before post title on homepage
- How to display the category featured images [closed]
- how do i set an image for a category in admin panel
- How to link images of one WP site to another WP site?
- How to create a photo gallery that can be filtered by the image categories
- Images as Categories
- In my wordpress admin panel Suddenly The Category, tag and featured Image Option are not showing
- Get categories list with category name in custom WP_List_Table class
- Get the ID of the current post’s child category
- filter a loop base on specific category
- Problem with multiple loops in wordpress theme
- Is wordpress compressing my images? if so, how to prevent it?
- Are term_taxonomy_id and term_id the same? [duplicate]
- Display all sub category but one
- Getting parent category hierarchy as objects from category template
- get category name in admin screen
- Return category posts with WP_Query
- WordPress get_categories & listing recent post thumbnail
- Add a category on all archive category pages
- why category__and and category__in wont work togather?
- Ordering categories by slug vs. name
- Let user select their own category
- Displaying year once in category.php [duplicate]
- Restrict CSS on one page
- Get the name of category in query
- what file I need to create to work date archive links?
- Include either name or slug in the include parameter using wp_list_categories?
- get cat id is not working from custom taxonomy
- Using in ‘category_name’ in ‘$query->set();’?
- Hide categories from frontend, but not admin / post editor
- Archive filtering
- Exclude categories from homepage not longer working
- Get a random thumbnail from posts belonging to a specific taxonomy
- Change appearance based on category but post is in two main categories
- multiple values in an array for category__and does not work with WP_Query
- List all posts of certain category which share some tags
- How can I check which archive has referred the single? [closed]
- Search form options group categories
- Custom Page Template Category loop not functioning correctly
- Copy post taxonomy?
- Remove category link
- How to store category and tags separatly on wordpress?
- How to hide widget from certain category
- Custom caption output for custom image size
- javascripts files not linking to my category slugs?
- custom query for both category and pages using global $wpdb;
- Category link redirect to custom template page instead of index.php?
- Generating a feed of all but one category of posts