Found a solution:
<?php
$cat = get_the_category();
$category_id = $cat[0]->term_id;
foreach (get_the_category() as $cat) :
$attachmentId = get_option("category_image_{$category_id}", 'null');
$imageArr = wp_get_attachment_image_src( $attachmentId, 'medium' );
$imageURL = $imageArr[0];
echo '<img src="' . $imageURL . '" />';
endforeach; ?>
Related Posts:
- Image Upload Custom Form Field for Category and Custom Taxonomy
- Images as Categories
- Need to echo category id in multi-dimensional array
- Illegal string offset ‘taxonomy’ in
- Style a category from category list
- Same menu for different taxonomies to reach different content
- Change categories count to include media attachments
- How to schedule categories?
- How to get selected taxonomy or category ID if using custom walker?
- Let user select their own category
- Copy post taxonomy?
- Category view with contents of [gallery]s shown
- How could I write a get_categories_by_year() function?
- Get posts in a subcategory of a chosen parent
- Setting selected term_id with wp_dropdown_categories?
- creating categories programmatically
- Natural sort / ordering wp_dropdown_categories
- How to add image for all posts associated to specified category?
- How to get posts using category slug in ClassiPress?
- Best way to categorize/populate a magazine style layout
- Combining these queries? (Same taxonomy term + same category as post)
- sidebar troubles, taxonomy trouble
- Displaying posts of given category
- get_the_category – display only a single category for a post (not all categories)
- display category with background color
- Category post count is not correct
- Disable Category Taxonomy
- How to display WooCommerce category image in my category page banner as a background?
- WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array
- Automatically adding tags and categories into Post Excerpt for searching
- How can i add service category here? [duplicate]
- Show subChild categories
- How can i change sort category view starting from child then parent, not alphabetically
- WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests
- How to set the same base url for two different taxonomies?
- How to make product image inherit from category image
- Limit categories to hierarchal depth of 2
- How to set acf color field as background color to product category
- How to target all woocommerce categories that don’t have any subcategories in them?
- How to display categories image in loop homepage WordPress
- Show the parent taxonomy by creating shortcode in woocommerce?
- Filtering posts in category by tag URL
- WordPress Portofolio Conditional Templating – functions php
- Parent Category and Subcategory default text generated with category
- Get WooCommerce product category list in functions.php
- Post List by category and under custom taxonomy
- Bulk assign posts to a category using SQL (MySQL)
- Change background image page header overlay for each category
- get taxonomy list in a page in the wordpress
- Number of categories slowing down the site
- outputting taxonomy hierarchy
- Icon images across multiple categories
- Confused about category.php template – not working
- Filter custom taxonomy posts via AJAX
- Create duplicate category page with content variations
- Why use hierarchical taxonomies instead of many custom taxonomies?
- Renaming default category taxonomy?
- How get all media from a posts category by db?
- How to echo Tags and Categories as plain text
- Media Categories as Classes on WordPress Gallery Shortcode
- How can I add HTML classes for current taxonomy/term hierarchy into my pages to simplify styles?
- How to Manage and link certain custom taxonomy?
- How to relocate images
- Display List of Categories Within a Custom Taxonomy
- Display Taxonomies in loop with template args
- In a shared site, how to get products in a category from one site to another?
- How to add a post with new Taxonomy without assigning to default category?
- Grouping parent categories into sections
- Display one post on category.php: Wrong featured image
- get_adjacent_post_link excluded_terms ignored
- Match two taxonomies to display a specific content
- Taxonomy for custom post type not found
- Category base 404 – fix
- Why is my post categories not displaying?
- Display only the latest post
- Category page with gallery for each post
- Problem importing categories and sub-categories
- Return selected categories only in custom page meta box?
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- list taxonomy based on taxonomy
- get IDs from links categories
- Image menu showing categories in page
- Multiple Parent Category URLs
- Chained drop-down menu for custom taxonomy using chained.js
- Show parent-child relationship for categories in the wordpress admin
- Display only one level subcategory in wordpress
- Get all first images of posts in same category
- Add category image before post title on homepage
- Converting Categories (with ACF fields) to custom taxonomies
- Woocommerce custom taxonomy order
- how do i set an image for a category in admin panel
- How to link images of one WP site to another WP site?
- Hook action when create new category [duplicate]
- Taxonomy term RestApi data 10 rows limitions
- Order Categories by Character Count
- How to create a photo gallery that can be filtered by the image categories
- hide_empty property not working when using get_terms
- Add custom fields to Woocommerce Category Page
- Quick Edit on taxonomy names results in error
- How to make /category/ URL load properly instead of 404 error?