You need to add get_post_thumbnail_id
and pass $post->ID
in wp_get_attachment_image_src
for e.g.
$image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
to get image url : $image_attributes[0]
Related Posts:
- Where to put my code: plugin or functions.php?
- How to display value of custom fields in page
- Custom post type single-{custom}.php not working
- Custom post type – order field
- Creating an Image-Centric Custom Post Type?
- Submit post and upload image from front-end
- Correctly delete posts with meta and attachments [duplicate]
- Change permalinks for posts but not for custom post types
- Mini-Site Strategy
- Attaching media to custom posts without editor
- Assign single template to multiple custom post types?
- Custom Post Type Permalink Page Not Found
- get attachments for all posts of particular post type
- How to build a complex page structure
- List most recent image uploads, but only for specific custom post type
- How to put custom post types on front page
- How to display custom field in product description?
- Manually adding current_page_parent to wp_list_pages()
- Post template not applying on theme (potentially rendering as Page template)
- Custom attachment function not working in v5.4.2?
- How to search through all child taxonomies using WP_Query?
- I have a random letter appearing before my content. Where to start looking for the cause?
- programmatically generated custom post type is created more than once
- Add extra elements to the_post in a custom post_type
- Visualize info in just custom post_type in theme
- cpt not display inside nav menu
- How to use posts as tabs in a custom page?
- Custom Post Taxonomy Template Not Loading Properly
- Custom Post Type has wrong label and is not found when called by a loop
- Custom post type single page uses the right template in preview mode but shows a different template after being posted
- Problem with multi checkboxes value in metabox?
- Custom Post Type archive page listing a 404 or single post
- Too many revision when post status is changes [duplicate]
- How to display only child category post in related posts in custom post type?
- Dupplication of Custom Post Type while adding attachment
- Create dynamic logo carousel without using any plugin
- Having issue on Loading Meta Data From CSV to CPT
- Front End users account with lots of user Roles (not Woocommerce)
- Values show up in custom home page but not in custom post pages
- Permanent Custom Post Type
- Custom post type that lets users create a set of posts?
- call a function when insert and update a custom post type
- Links Image in “Catalog” Page to Posts
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- creating a custom post template
- 2 custom posts types, in their own columns, one pagination for both
- Update Cateogory Taxonomy Count for Attachment Post Type
- WordPress is giving a warning but my code is working fine
- wordpress query_posts with foundation 6 Accordion not working correctly
- Creating Slider in wordpress theme with custom post
- Help with Multi Level Category Archive Page
- Not Able to Get Custom Post Type in Single and Single-custom-post-type
- How To Display Category list from Portfolio post type plugin?
- How to develop custom URL redirection
- Delete custom post type metadata without deleting the post in admin area
- Loop carousel slider in wordpress
- Custom post type with custom taxonomy permalinks
- Using piklist meta box, strange behavior
- Custom taxonomy page template
- get_pages can’t load pages with custom post types
- Cant insert wrapper div into index.php
- Search form to find custom meta box generated data
- erase post excerpt limitation [×]
- show custom taxonomies in hierarchy
- How can I detect a chosen Isotope layout option from within Javascript to generate appropriate layout?
- Add “post option” support parameter in custom post type using Hueman Theme?
- How to Display CPT Posts on index Page
- Query custom post type and showing its content
- Issue on Counting CPT’s Under Taxonomy Term
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Function that get ACF fields value before saving
- Delete attachment with post
- Why is my custom form saving with ‘autodraft’ as title and slug?
- Having some trouble properly displaying Custom Post Types in templates
- Displaying information from Custom Fields in template with Types?
- Author profile comments system
- How to Create Custom Post Type with Multiple Color Options?
- Create custom post order (with custom post type meta)
- Custom post type and custom taxonomy archive inaccessible
- Apply custom names for generic custom taxonomy name?
- Change position of Post Formats box?
- Category names on CPT archive pages [closed]
- Single page for Custom Post Type not found
- How to manage wordpress knowledge base/wiki/posts collections
- How to create custom page templates with default page layout framework?
- Passing postid of Testimonial Custom Post in Shortcode Parameter
- Retrieve a post with its ACF repeater fields in wordpress
- Need some hints for my own WP theme development
- Can you programme the selected page template to display block patterns automatically?
- WordPress search results grouped by post type
- Show custom post type on post category page doesn’t work / breaks navigation
- REQUIRED: The theme uses the register_post_type() function, which is plugin-territory
- Default WordPress Query for a Specific Custom Post Type URL
- Display custom post type attached media file sizes
- How to check if a custom post type uses a custom template?
- How to build help pages similar to WordPress Developer Resources
- Custom PHP Template in Twenty Twenty-Four
- ACF Pro simple Business Directory – Requesting assistance with created Templates and associated Functions.php Coding
- Get a custom post type’s taxonomy type term names displayed as checkboxes and filter
- Adding a new custom post type using the editor causes 502 bad gateway error