I’m pretty sure you want something like this:
$myfield = get_post_meta($post->ID, 'short', true);
if ($myfield) {
echo do_shortcode($myfield);
} else {
the_post_thumbnail();
}
Related Posts:
- Move from old custom field to new post_thumbnails
- Is there a hook / action that is triggered when adding or removing a post thumbnail?
- How can I migrate all of my custom field thumbnails to the built-in post featured image?
- automatically set “Featured Image” the same as the og:i that is set in a custom field
- Adding a custom field or metabox to the post-thumbnail widget?
- Deleted pages showing up when querying for child pages
- Add url from Custom Field as ‘Featured Image’. Code not working
- For homepage images (for small business website), is it better to use custom fields or post_thumbnail?
- How to mass update custom fields for more than 20k posts
- how to make nsfw post with thumbanil
- Can I use a Custom Field as the Featured Image URL?
- Getting the Featured image URL and inserting it as Custom Field on Post update / publish
- User customising position of WordPress Featured Image
- Set featured image from custom field URL
- Custom field as featured image caption
- WP Insert post with post_thumbnail
- Custom field image to Featured Image
- Selectively hiding or allowing thumbnails of featured images on front page
- use custom field value as featured image
- Can you generate a featured image from two images from custom fields?
- Use a different catalog image than the featured image
- Automatically set the_post_thumbnail to Custom Field Value
- Related post thumbnail not showing up
- Post thumbnail size for custom field only
- How to mark a image attachment as background image?
- Custom field for image, not showing image!
- Crop custom image size vs actual size
- Where are custom field values stored in the database
- Using TinyMce with textareas in meta boxes on custom post types
- ACF – get_field() using ‘option’ as post_id not working
- How to set a default meta value for custom field
- Populating meta box with select-list of existing posts, and assigning it to custom post types
- Create meta boxes that don’t show in custom fields
- wp_editor in add_meta_boxes does not show gallery
- Deleting a custom field field
- custom field to always to .get_the_title()?
- Displaying posts with only upcoming dates according their custom field date value
- How to filter a dd/mm/yyyy date from a custom field in a query
- How do I add custom_meta_box_id’s value?
- Get a post_id where meta_value equals something in a serialized meta_value field
- List posts with common custom field value
- Including Database Generated Pages in Site Search [closed]
- Is it bad to use a lot of Custom Meta Fields?
- How to save media files under custom folder without changing wp-config.php or changing media settings
- How can I sort homepage by a meta value?
- get_posts that match a user-specified value on a page
- How to add image attachment to post from a single meta key (Woocommerce)
- Custom Fields – Taller editing area
- How to add Advenced Custom Fields In Single Post
- Get updated meta value after post update or published (custom post type) using hook
- custom-meta-box checkboxes from loop won’t save
- Custom dropdown field added to media gallery; how to get it to save properly?
- Uploading PDF using Media Uploader
- Correct syntax for retrieving custom field in CPT
- $TBA Getting Translated to $0 (Custom Fields)
- How Do I Display A Custom Field In The Sidebar Of All My Pages?
- Hide text if one custom field out of two is empty [closed]
- Echo the custom field value from the latest post from the ‘video’ post format?
- Custom Field – Do Not Show if Value is Empty?
- What’s the best way to implement custom widgets on a per post basis?
- Displaying Meta-Box Data Properly
- wp custom field date format compare
- frontend submit post jQuery clone row won’t save
- Include one custom field in search results
- Custom search SQL Query to add custom field in result
- Search Results Page – Displaying Custom Meta Fields
- Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
- using advanced custom field to control css hover color
- Custom Field data only shows after manual post update
- Custom field Search with Relavanssi
- How to exclude custom fields from search queries?
- Add Custom Fields After Page Title
- Footnotes in custom fields
- How to show content of custom fields in search results?
- simple fields plugin custom query
- Set class if a meta value is set within post archive
- Filtering posts by ACF meta query
- Allow HTML in Custom Metabox area
- checking liked user in wordpress rest api
- How to display selected option from dropdown list in a metabox
- How to use a custom field with add_rewrite_rule()?
- User custom meta delete by serialised key value
- Metabox value for post loop?
- How to add a default field Name to post Custom Fields
- Using ACF Custom Field value in a URL with do_shortcode() [closed]
- Custom Post Field -> Returning only the word “array”
- Register author, facebook connect, publish posts from front end
- Extend WP_Customize_Control with Multiple Field Control
- How to use page metadata while using wp_list_pages()?
- Validating custom meta boxes with jQuery results in posts being saved as draft instead of published post
- Running a Gallery Shortcode in a Custom Fields Widget
- How can I create more “create attachment” custom field – any idea?
- Custom Metaboxes, multiple post selection
- How to sort Custom Fields by a value
- How to show custom field and parent post id in wordpress attachment page (image.php)
- Multiple image uploader under editor?
- Display agents (custom post type) alphabetically, except one who always shows last
- Custom Search, MySql Query Gone Wrong?
- How enter custom post meta or custom field on box post list archive page?
- Send checkout page custom field in order email