What you are looking for is the_post_thumbnail();
.
You should do something like this:
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail(); ?>
<?php endif; ?>
More information can be found here.
Related Posts:
- Display All Products by Category with WooCommerce
- Add a URL prefix to permalinks of one category of posts only
- Woocommerce get category image full size
- Add forward slash on categories url (serve one version of a url)
- Elegant way to add parent categories?
- Alphabetical Index Page
- adding custom fields to next and previous post link
- Categories Listing with “selected” category highlighted
- Assign parent category to all posts that are already assigned to child category
- Using same slug name for a page and category
- List Categories of the Parent Category of the Current Category
- Link each category to last post
- Auto add pages to category menu
- Removing the number in a category slug
- Getting WordPress custom taxonomy/category?
- Get term by slug in Gutenberg
- How to get post category title within the loop?
- If category is in parent category?
- Hide posts of a certain category unless logged in
- Show only first children level of current category?
- Problem displaying one post from each category
- How do I automatically put categories and their descriptions on a WP Page?
- Taxonomy filter all children
- Show number of articles in menu
- Can you pre-check wordpress categories?
- If posts category is “cars”, display image
- How to prevent parent being choosen in wp_dropdown_categories
- query in category.php repeats itself
- Subcategories with the same name
- How can I add more “filters” to my products? (Categories, attributes, etc.)
- Removing post category base giving Error 404
- Remove product category placeholder image (Woocomerce)
- How to “group” (categorize) the Pages together?
- Is There a Difference Between Taxonomies and Categories?
- Style category link depending on category ID
- Custom Walker for wp_list_categories
- Related Tags not in category
- Output category color option to each li item
- How do I display only two categories Instead of displaying all categories
- Hooking to walker_nav_menu_start_el to insert list of subpages
- Show the latest post from child category?
- How do I add a tag slug to a category URL to filter posts?
- How to show a list of only categories (exclude subcategories)
- How to list categories in reverse alphabetical order?
- I want to show category name when using [category] shortcode
- Category list with postcount
- Dropdown menu for subcategories
- How to add categories on a page [duplicate]
- Adding custom ID field to the categories
- How to hide some categories in dashboard
- How to choose the content from a post which is in the right category?
- Getting the first parent of a hierarchical term
- How to get category id’s which are added in main menu?
- Return category posts with WP_Query
- Include either name or slug in the include parameter using wp_list_categories?
- get cat id is not working from custom taxonomy
- Category List and Automatic jQuery classes
- How to add image for all posts associated to specified category?
- Show the current post’s category, without displaying parent category
- get all categories’ latest post in one query
- Categories show 404 error on multisite installation
- Show posts from category specified using a custom field
- display category with background color
- WooCommerce Product category can be shown with multiple related URLs
- excude a specidic category from showing in the “relative posts”
- Categories are not available AT ALL under Menus
- change image on single product page with js
- Filtering blog posts by category
- How to get all post categories without custom post type categories?
- Get Categories of multiple posts
- Show subcategories broken when WP/WC updates
- Display menu in category and sub category
- Displaying a Category on a WordPress Page
- Show alternative menu based on page template AND post category
- How to change category labels in different colors?
- Display some WordPress categories as random order
- Display Category yearly wise in wp
- Get all subcategories IDs from categorie or categorieIDs
- Redirect category archives to pages
- How to create a category loop on my blog (ACF Plugin)
- Using heirarchial tags or Custom taxonomies
- On main page, in each post, display image depending on post category
- WordPress categories hierachy issue
- Get posts base on category ratio of more then two categories
- Pagination does not work with query_posts()
- Images appear in the header on all pages, but not category.php
- Change single.php template based on parent category
- WordPress and “pretty permalink”
- Custom file with special code of category widget
- Custom field picture instead of post thumbnail on category page
- New Category – custom taxonomy
- Using categories and pages in menus
- Gettind 404 not found wen click the view button for a given category custom post type portfolio
- list first post of Child Category on Category page
- Use get variable when rewritten url in wordpress
- Back to category link
- Custom Woocommerce Category view
- exclude category in loop.php
- Show thumbnails 1-12 of category x on any given page
- How to delete categories in WordPress