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
- How to display non-hierarchical taxonomy as terms with checkboxes?
- get_categories for custom post type with a specific custom taxonomy attached
- Could not insert term into the database
- Combine two taxonomies in a hierarchical tree
- Weird behaviour when adding terms/term_taxonomies programmatically
- How can I select a primary category?
- How to Override default update_count_callback for category
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- How to get the number of child categories a specific parent category has?
- What’s the difference between “parent” and “category_parent” in a WP_Term object?
- How can I convert some categories to a custom taxonomy?
- Any way to assign Post Categories and Tags to Links?
- Display name of the last child category
- Want to hide some categories from the categories meta box in the post editor for the two specific user roles
- How to export/import categories and keep their IDs?
- How to use wp_category_checklist()?
- Get all sub-categories of a parent category
- Display the featured image from the last post
- Can I use get_adjacent_post for specific categories?
- How to view WordPress’ default category IDs?
- Random taxonomy category list
- Extract image url associated to a category
- Change existing taxonomy settings when using custom taxonomy
- How to get the id from the custom category?
- category filter doesn’t work in WPML
- Link Attachment Image to Category
- How can i insert term in a specific language of Polylang?
- Filtering *out* a taxonomy from the admin post list
- Drop posts from categories in MySql
- get_post_meta not working on category.php
- Customize category page for different custom taxonomies
- How can I improve this taxonomy treating approach?
- Get posts under a category with SQL
- Redirect to another page using contact form 7? [closed]
- Display custom taxonomy attached to the post on post single page
- How to display parents category and child category separately for a specific post?
- Admin: Navigation Menus do not show empty categories/taxonomies in the list’s search tab
- Display sibling categories on category page
- How to display a value inside a post with a specified category from a category custom field? [closed]
- Echo text using is_tag
- Grandchild Term Things Grandfather Term is It’s Parent
- WP 4.7 in_category change?
- Get posts of a custom post type from category from taxonomy?
- Illegal string offset ‘taxonomy’ in
- Same menu for different taxonomies to reach different content
- Change categories count to include media attachments
- How to get selected taxonomy or category ID if using custom walker?
- Let user select their own category
- 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
- Best way to categorize/populate a magazine style layout
- sidebar troubles, taxonomy trouble
- Displaying posts of given category
- 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
- 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?
- Limit categories to hierarchal depth of 2
- Show the parent taxonomy by creating shortcode in woocommerce?
- 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
- Change background image page header overlay for each category
- outputting taxonomy hierarchy
- Icon images across multiple categories
- Confused about category.php template – not working
- Create duplicate category page with content variations
- Why use hierarchical taxonomies instead of many custom taxonomies?
- Renaming default category taxonomy?
- Media Categories as Classes on WordPress Gallery Shortcode
- How to Manage and link certain custom taxonomy?
- How to relocate images
- 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?
- Display only the latest post
- Problem importing categories and sub-categories
- Return selected categories only in custom page meta box?
- 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
- 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
- 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
- Quick Edit on taxonomy names results in error