Are you trying to show the ‘featured image’? Or can you use it?
If so, there is a simple way to do it:
Add this line of code in your theme’s functions.php file, or be sure that it has this:
add_theme_support( 'post-thumbnails' );
Add this line where you want to show the image:
the_post_thumbnail();
Following what you seem to be doing, that is, using a meta field, try to put in a variable before echoing, sometimes it helps me spoting another problems in the code. Ex:
$key_1_value = get_post_meta($post->ID, $key, true);
echo $key_1_value;
Related Posts:
- Migrating a taxonomy’s tags to the native category
- Custom post type is using the index.php template
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- What is the best practice for displaying my plugin content in themes?
- Content vs Template on custom post
- How to use custom template files in deeper directory?
- WordPress Doesn’t Generate Taxonomy Archive
- A case for Hierarchical Custom Posts
- Custom taxonomy returns 404
- Filter widget outputs
- Adding Page Templates to post but it ignored it
- Template for all categories of a custom post type?
- Flush Rewrite Rules when new site is created on network
- Adding custom image sizes and post types to a plugin or to a theme?
- Want to be able to sign up subscribers as authors
- WordPress custom taxonomy template not working
- How do I set a custom page template for a custom post type?
- How can I get this request to use the Custom Post Type page template instead?
- How to specify a template for a path like http://example.com/something?
- Custom templates for a specific category
- Archive for a Taxonomy of a Custom Post type
- Custom post type pages return 404 page?
- Unable to set featured image
- WordPress 3.9 not using custom template
- Template files for Custom Post Type and Taxonomy
- Set templates for custom post types
- How to Create Template File for Parent Page of Custom Post Type
- Custom post_type search pages
- how to remove pages loading with the archive templates
- Main query not querying any posts in custom taxonomy template
- Custom Empty Results page for my Custom Post Type
- Custom posts template page
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- How can I use archive-{post_type}.php theme template?
- Running a song lyrics site on WordPress
- Using page slug in wp_query
- Specify a particular page to list all custom types
- uploading problem of wordpress theme
- How to have permalink like domain.com/term/postname?
- Page Template Dropdown For Custom Post Types
- make permalink go to a custom single.php file
- Add Previous/Next Buttons to CPT Single Pages Only
- Custom post types problem
- Creating Sections for Post Types
- Custom post types with categories in template
- Creating separate feeds for custom post types
- Which file/template is in charge of taxonomies for custom post types?
- How can I trace inconsistency in loading a template?
- why post_class() function apply css classes to all other files?
- How to get_term_meta on single custom post?
- Template Hierarchy for custom post type pages
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- How do I find a way to create a global single.php for a custom post type?
- How do I assign a block template (.html) to a custom post type?
- Templates for hierarchical custom post type
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Custom Post Type setup
- Apply template by path/slug related to custom post type?
- assign different templates to custom post type with homepage loop
- How to get the current category with custom posts
- Create a simple Testimonial page
- Assign a template to a custom post type when displayed by the main loop on the home page
- One Site. One Theme. Multiple Stylesheets without plugins?
- Custom Post Type – Portfolio no longer works
- Methods for development wordpress themes [closed]
- Render a Post or Page using the correct file
- Can I assign a theme to a custom post type?
- Get template part with CPT and Custom Taxonomy conditionals
- Template code to split a post and print a custom field?
- Displaying a list of Contacts
- How to create a template to show child terms of a MAIN taxonomy
- How to change single custom post template by custom taxonomy?
- Custom Post Type homepage template
- Custom permalink structure for remote content pages
- Setting a homepage – doesn’t seem to work
- How to create a archive template for custom post type [duplicate]
- WP not recognizing custom post type / template
- Archive Template being used instead of Category Template for Custom Post Type
- Custom post type draft use wrong template
- List of a specific Custom Post Type in Custom Template
- Create a custom taxonomy template that loops through child categories in term order?
- Display Posts Query with IF function
- My template won’t apply, theme still fallback to index.php
- How can I add in post’s the text “No content”
- Require custom post type if is_admin() – template doesn’t show up?
- Custom Post Type – Main page for certain posts
- How to customize `Edit-Post` Screen
- Calling a div and content in php?
- display two images in theme header.php file
- Tag template not returning posts [closed]
- Set generic reservation form for custom post type
- Function to allow single post template based on custom taxonomy?
- Shortcode in pages or tempate files for custom post type
- One Custom Post Type two different Templates
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- Specifying a template for custom post type pages
- handling templates and widgets for custom content types
- Conflict in function to allow single post template based on category