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?
- 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]
- 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
- Why are image thumbnails cropped proportionally (not per dimensions)?
- 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
- Why are image thumbnails cropped proportionally (not per dimensions)?
- 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 call custom function from functions.php in site-wide template files?
- How to use thumbnails in gallery?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- How to display a default image for post thumbnail using functions.php?
- Change size and crop medium_large images
- 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?
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Overwriting Parent Theme’s Image Sizes
- Pulling Twitter RSS feed not working as expected (fatal error)
- set_post_thumbnail when user is not logged in
- 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
- Usage of theme name in functions
- Functions.php Problem
- Redirect to another page using contact form 7? [closed]
- ACF not showing
- It does not work concatenation in function.php
- How to retrieve the current post’s generated featured image size?
- Way to store featured image width and height in two separate variables?
- Remove Custuomize Sections
- Can we create our own theme’s function.php?
- Define PHP variable from a seperate API if statement
- Excerpt for pages not showing
- get_pages() Returns Only One Item
- Does size of a theme’s functions.php file matter?
- Can set_post_thumbnail be used to remove a thumbnail?
- 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
- How to add a new image size and apply it to posts only?
- 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
- Change custom featured image size in twentythirteen child theme
- resizing of thumbnails not working
- How to make excerpt image be full size instead of thumbnail?
- show all the posts thumbnails
- include w_thumbnail_src in function?
- Custom image sizes showing in Classic Editor only when upladed directly to post
- How to fix Function create_function() is deprecated in / themes
- WordPress wp_dequeue_script remove all other scripts
- remove_filter function to unhook twentysixteen parent theme function
- wp_title() return random number
- How to offset main query without affecting other queries and backend
- Add meta data in head from theme
- Featured image on archive page based on post type
- 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();
- How to disable site title and description when custom header is uploaded on the customizer?
- Best way to add image to recent posts widget?
- 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
- Full size image option removing problem
- apply_filters to featured image
- Add the title of a widget as an ID – for anchor links
- 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?