I don’t see why something like this wouldnt work!
$med_post_thumb = get_the_post_thumbnail($post->ID, 'medium_post_thumbnails', array('class' => 'img-fluid')). '</a></div>';
$full_post_thumb = get_the_post_thumbnail($post->ID, 'FULL SIZE GOES HERE', array('class' => 'img-fluid')). '</a></div>';
if ($med_post_thumb == NULL)
{
echo $full_post_thumb;
}
else
{
echo $med_post_thumb;
}
Related Posts:
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- No src and sizes attributes present on WordPress thumbnail images; the smallest image size is loaded irregardless of viewport size
- add_image_size() parameter four ($crop = true) is ignored: the_post_thumbnail() returns scaled image(s) instead of hard cropped
- Missing feature image link function
- Issues with title-tag and document_title_parts
- Is it ok to use a function to output the text domain name in a wordpress theme
- Display random categories on the front page (Finding and Editing Theme Functions)
- How to get woocommerce inventory status [closed]
- TinyMCE custom styles remove class when switching styles
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- Automatically set the featured image
- Get recent posts with thumbnail
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
- How to change post thumbnail title and alt attributes to post title?
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Organize functions.php
- Add options to featured image
- How to override functions.php in child theme?
- Some questions about how proper add 2 CSS file in a WordPress theme?
- is there a way to remove featured image from blog page and single page
- How to hide image-url if no attachment?
- Does size of a theme’s functions.php file matter?
- Functions php shortcode for displaying main menu with no child items
- Can set_post_thumbnail be used to remove a thumbnail?
- Can’t locate custom image sizes defined by child theme
- get_next_posts_link() returns no result despite available posts
- Nav menus all outputting the same links
- PHP 7.1 | Warning: A non-numeric value encountered in
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- Getting the teaser text without overriding global variables
- Combine two active_callbacks into one on theme customizer
- WP Customizer API loaded into functions.php
- call_user_func_array() expects parameter 1 to be a valid callback, function
- why can’t i add front.css to my frontpage.php
- How to add a new image size and apply it to posts only?
- “options.php” not found
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Is this an acceptable practice for WordPress theme development?
- What is the correct way to include my new functions and scripts in WordPress?
- wp_nav_menu work in functions.php but not in the theme
- Rewrite Question Mark in Post Template with URL Parameter for clean URLs
- contact form in template with jquery,validate and ajax
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Show Featured Image in else statement
- Change custom featured image size in twentythirteen child theme
- How to add icon over specific thumb
- resizing of thumbnails not working
- Featured Image keeps cropping
- How to make excerpt image be full size instead of thumbnail?
- show all the posts thumbnails
- struggling with syntax for the_post_thumbnail();
- include w_thumbnail_src in function?
- Woocommerce Variable Product Dropdown for Custom Shop Template
- Custom image sizes showing in Classic Editor only when upladed directly to post
- How to fix Function create_function() is deprecated in / themes
- Exclude specific post from query
- Advanced method to control cache of enqueued style/script
- Which filter fires upon setting a featured image
- WordPress wp_dequeue_script remove all other scripts
- Is_Page doesnt detect my page
- remove_filter function to unhook twentysixteen parent theme function
- Test CDN link from function.php or wp_enqueue_script/style?
- How to customize archive widget only for cpt?
- Can You Set A Minimum Image Dimension For Resizing Images?
- wp_title() return random number
- Why does echo on functions.php not yield result in source code?
- How to offset main query without affecting other queries and backend
- Add meta data in head from theme
- what is `get_section()` and how to use it?
- Featured image on archive page based on post type
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- Printing medium sized image
- Sticky – Featured Image
- How to retrieve image IDs from shortcode content?
- HowTo: Add wrapper to columns shortcode?
- How to create admin ajax function for my contact form
- Class::$template_dir_path=get_template_directory();
- Frontend Feature image upload not work
- How to disable site title and description when custom header is uploaded on the customizer?
- Best way to add image to recent posts widget?
- Slider Thumbnail Size Issue [closed]
- Remove Featured Images from Posts Older Than a Certain Date
- wordpress not calling peliegro functions.php?
- Language switcher for subdomains
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Load a Child Theme’s style.css just before the closing tag
- wp_nav_walker that interacts with widgets to setup mega menu
- Apply height and width for the_content() inside youtube video tag
- Allow tags and attributes in post and pages content
- Set thumbnail from URL, by grabbing image in functions.php
- add_theme_support not outputting thumbnails
- Full size image option removing problem
- apply_filters to featured image
- Add the title of a widget as an ID – for anchor links
- Image width issue in IE [closed]
- Add custom css to theme
- Why functions metaboxes is causing White Screen in Admin [closed]