You are using the_post_thumbnail()
which will echo the actual thumbnail. You should use get_the_post_thumbnail()
if you want the value to be returned, not echoed.
So, change:
$slide_img = the_post_thumbnail();
To:
$slide_img = get_the_post_thumbnail();
You should also, as Matt points out, make sure you are using the correct meta field names and check if the values are set correctly.
Related Posts:
- Grossly inefficient wordpress loops!
- Automatically adding meta data to posts or multiple query help
- Displaying custom posts only if custom meta box’s date is not expired
- get_template_part() – post-meta not working?
- Create a random unique 6 digit number as custom field for custom post type
- My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
- Meta Key Value in current-user-only loop
- Storing a many to many post type relationship in post meta and keeping SQL ability for Joins
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- How can I loop at a Specific Taxonomy from a custom post type?
- Custom archive page for custom taxonomy and pagination issue
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Staggering featured post using ‘sticky’
- get_post_meta for Custom Post Type ( CPT )
- How to create content automatically when a post is published?
- why get_post_meta is returning 0?
- A to Z List of Custom Post Type in three columns
- Custom post type, organized by categories
- post meta parameter in post custom-post-type endpoint with restapi
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- What’s the WP way to load remaining custom posts?
- Update postmeta Parent when post_status child change
- WP Query with categories only shows one post and ignores the category
- What to and how to proceed with CPT to make DB small and efficient?
- Metabox not show in categories custom post type cmb2
- WordPress request fiter order by related post’s post_title
- Post ID randomly printing on page
- A custom post within a custom post
- Display Custom Taxonomy Alphabetically
- Full Custom Post Type List Organised by two Taxonomies
- Displaying Custom Posts on a Page
- Shortcode not working with post counter
- Problem: wp_query outputs all images on site
- Display post content with respect to its title?
- Update database from Quick Edit according to Checkbox state of Custom Post Type
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- Get custom post type’s fields in a while loop as variables
- Custom Post Type within the Loop on Homepage (Page Template)
- Dynamic Custom Fields
- The loop seems stuck to a single (now deleted) post
- Show Custom Post Type meta boxes only on Page Edit
- Posts per row on archive page (custom post type)
- How do I know the ‘meta_key’ for ordering my custom post type
- Custom filter function not working with Custom post type
- Limit the post for differents custom post type in the same wp_query
- Custom Theme With Custom Loops
- Custom Post Types strange pagination problem
- Custom post type conditional in loop
- Importing Data from a Non-WordPress database, into WP
- Listing all term items alphabetically / sorting loop
- Getting thumbnails of a custom posts featured images in a page-templates metabox
- Display related custom taxonomy posts in sidebar
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- Remove Post Custom Meta Box
- pagination not working for category.php (custom post types in categories)
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- How do I control the output of a custom post type in the loop?
- Display custom post type posts first, then default posts
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Custom fields for custom post type
- Three Most Recent Posts, One Per Term
- Targeting custom post type
- Show future events based on custom field AND order by date
- Does WP have a global of $id?
- WordPress Loop if/else
- get_the_title() is returning results from previous loop
- Meta Data for Custom Post Type not saving
- Using preg_replace to filter custom textarea
- Custom Post Loop pulling all custom posts, not just one
- Conditional for a Single Post That Belongs to a Category?
- Wrapping x posts in html without leaving empty html
- WP Query post__in not returning correct results
- Custom Post Type single.php template only shows the latest post
- Sort posts in loop by the WooCommerce Membership of the author
- Check if post with same meta value exists
- Filter date from post meta when date is in string format
- Including all post id’s of a custom post type into an array
- How to include custom post type posts on a page?
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Tag page only display 10 posts
- Get only used meta_values
- If Post Meta Equals Current Title Conditional Advanced Custom Fields
- Custom Post Types — $args vs. labels array
- Is there a way to exclude posts based on meta_values?
- Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
- How can I group posts by months and years?
- Pagination Error : Duplicate argument being outputted
- Get an array wich contains the post_name of every post that has the custom post_type “pelicula”
- get_post_type is always post
- Archieve.php not loading for custom post type
- Multiple Custom Post Type queries, how to DRY it up
- Custon Content within WordPress Loop
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Add first letter of titles to array, then compare arrays
- Bootstrap accordion looping through posts incorrectly
- Main query not querying any posts in custom taxonomy template
- Loop increase number
- Custom post type showing same Post on all Pages