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
- Issues with title-tag and document_title_parts
- Display random categories on the front page (Finding and Editing Theme Functions)
- How to get woocommerce inventory status [closed]
- 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
- 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
- How to override functions.php in child theme?
- Linking thumbnail to full size image
- Generating Responsive Background Image Sizes in PHP
- Change parent theme file function in child themes functions.php
- Add inline css to theme
- Add a Post Thumbnail to an RSS Feed with custom size
- Make WordPress size and name images for Retina.js
- the_post_thumbnail fallback using hooks
- Display height and width properties with the_post_thumbnail() or related function
- Dequeue script in template isn’t working
- Add external js file to footer with id
- Changing itemprop from logo to image on custom logo?
- How to add background image control to page admin controls?
- Removing the first image in content
- How to set the jpg image compression for specific thumbnail sizes?
- Function to auto-set a featured image that is already in use
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Show excerpt for only first post in query
- How to add css class to image attached in all the posts?
- How to call custom function from functions.php in site-wide template files?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- Is there a way to add a class to non current menu item?
- Change size and crop medium_large images
- wp_get_attachment_image function size argument not working if I also add a custom class
- How to enable template page only for a post id page
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- Add caption functionality to custom WordPress theme
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- set_post_thumbnail when user is not logged in
- How to stop twenty fifteen theme from cropping featured images?
- Best practices regarding the creation of custom widgets?
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- how can I edit flexslider in woocommerce. [Urgent]
- enqueue styles for only mobile wp
- Jquery implementation not working on page reload
- Can’t generate thumbnail images
- Redirect to another page using contact form 7? [closed]
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- Control the srcset much more (not all sizes in it each time)
- Remove Custuomize Sections
- Can we create our own theme’s function.php?
- Define PHP variable from a seperate API if statement
- get_pages() Returns Only One Item
- How to hide image-url if no attachment?
- Does size of a theme’s functions.php file matter?
- Can set_post_thumbnail be used to remove a thumbnail?
- Getting the teaser text without overriding global variables
- Combine two active_callbacks into one on theme customizer
- 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?
- 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
- contact form in template with jquery,validate and ajax
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Show Featured Image in else statement
- 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?
- struggling with syntax for the_post_thumbnail();
- include w_thumbnail_src in function?
- Woocommerce Variable Product Dropdown for Custom Shop Template
- How to fix Function create_function() is deprecated in / themes
- Exclude specific post from query
- Advanced method to control cache of enqueued style/script
- WordPress wp_dequeue_script remove all other scripts
- Can You Set A Minimum Image Dimension For Resizing Images?
- Why does echo on functions.php not yield result in source code?
- Featured image on archive page based on post type
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- How to retrieve image IDs from shortcode content?
- HowTo: Add wrapper to columns shortcode?
- Class::$template_dir_path=get_template_directory();
- Best way to add image to recent posts widget?
- Slider Thumbnail Size Issue [closed]
- 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]
- 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
- add_theme_support not outputting thumbnails
- apply_filters to featured image
- Add custom css to theme
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- How to get postId from the argument $block when register_block_type()?
- WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?
- Second featured image only shows in metabox preview after saving a post in the wordpress editor