You can get the image from your $thumb integer with the following additional code:
$thumb = get_post_meta($p,"_thumbnail_id",true);
$image = wp_get_attachment_image_src($thumb);
echo $image[0];
This will return the URL of the image, just put that in an img tag to display it.
Related Posts:
- Query all posts where a meta key does not exist
- Correctly delete posts with meta and attachments [duplicate]
- Storing revisions of metadata for custom post type
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- How can I filter posts by post_parent in the admin?
- Custom Post Type with Input fields to seperate table on database.
- How to create a mini directory in WordPress?
- How Can I save multiple records in same meta key?
- Detect meta value changes when post is updated (post_updated)
- Search everything (posts, pages, tags, cpt, meta)
- Permalinks using event date (year & month) instead of publication date
- Compare 3 custom fields and sort by oldest
- Creating a custom post type upon registration
- Reason action hook won’t work with update_post_meta from frontend form? Alternative?
- Can’t sort order of wp_query with 2 meta keys
- Showing Meta Data for Custom Post Types?
- How to get source of custom meta image?
- Having trouble with custom post type / meta box
- Query for posts from any post type but only add instock products
- update custom post type meta from a shortcode
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Displaying Meta Box Image
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- Show metabox in custom-post-template depending on taxonomy term?
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Using date stored as custom field to filter posts displayed in admin
- Meta Box Only in CPT Edit Page, Not in Add New
- get_post_meta is returning image id
- get_template_part() – post-meta not working?
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Populate Custom Fields in a Custom Post Type?
- Update CPT post meta with update_post_meta and cron job
- Custom meta box data array: foreach not working correctly?
- How to check if user meta field is empty in conditional else statement
- Get posts between custom dates
- Post image in WordPress not appearing on home page
- A better way to add a meta box to custom post types
- Should wp_postmeta meta_key always be unique for a given post_id?
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
- Custom fields for custom post type
- Is there a way to exclude posts based on meta_values?
- Submitting Custom Post Types with custom fields from Front-end form
- create custom meta box with default value
- How to Echo Metadata Value in Currency Format
- Filter posts by tax (dropdown) and meta value
- Publish and save specific postmeta to a filtered post_type
- How to move a post to different post type with all meta data?
- WP API Response does not show my registered metadata
- Batch Extract Date from post title and put into ACF custom field
- How to handle this specific case of custom post type?
- Save CTP post meta different values each day without overwriting previous values
- get_post_meta returns NULL in front-end, but correct result in back-end
- Problem with adding custom post type meta to header by plugin
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Echo custom post meta from options array
- Value of post meta dropdown is not showing in WordPress
- WP_Meta_Query object with conditionals
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- HM CMB: Post Select Field for CPT ID
- Getting WordPress to store 0 values for custom post type meta
- Problem Saving Custom Post Type Meta Values
- Should I use a custom taxonomy or custom post type for grouping a list of panels associated with a group of tests?
- Get_post_custom not fetching value from array wordpress
- Save data is post using php front end
- Creating a custom post type upon registration for a specific user role
- How to sort by multiple values in a nested WP_Query
- Where is get_post_meta value located?
- How do I create a customised table list of a custom post type (in the admin area)?
- Unknown Post Meta Records
- Get Previous Post based on Custom Field Name, for Custom Post Type
- Saving custom post types post_meta over REST-API fails
- add action save post type and update post meta woocommerce
- get_post_meta not working with variable as a post_id for dynamically get the postid
- How to save post_status using action save_post?
- Custom post meta box as a sub form
- Metaboxes in Loop
- Add more custom fields when creating a new custom post type
- Custom meta box data not saving
- Stripe multiple transactions
- Collect custom post in a calendar
- Storing data in a multidimensional array from dynamically generated foreach loop
- Disable Facebook Comments Automatically On CPT
- Problem with ‘save_post’ hook not running
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Values inside a custom field to determine which category posts to display
- Timetable of Custom Meta Data using Custom Post Type and Custom Taxonomy
- How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?
- Change the contents of a dropdown through the admin panel?
- Advanced search form with filters for custom taxonomies and custom fields
- Top 30 Songs using Custom Post Type
- Advice Needed for Post Meta Database Efficiency
- fetch meta fields inside a widget
- Querying meta values within an array
- why get_post_meta is returning 0?
- Save post_parent in a custom post type
- Use a Variable in update_post_meta as the $meta_key
- Update an existing post in a custom post type
- Changing to different post type maintains the redirection?
- How do I add the “orange counter” next to a Custom Post Type?