how to place ELSE on if function on multipostthumbnails? [closed]

Either if ( class_exists(‘MultiPostThumbnails’) ) : MultiPostThumbnails::the_post_thumbnail(get_post_type()); else: //someimage endif; OR if ( class_exists(‘MultiPostThumbnails’) ) { MultiPostThumbnails::the_post_thumbnail(get_post_type()); } else { //someimage } In regards to your comment: if ( class_exists(‘MultiPostThumbnails’) ) : $image = MultiPostThumbnails::get_the_post_thumbnail( get_post_type(), ‘secondary-image’, NULL, ‘proimg’, array(‘class’ => ‘img-responsive imgwid’) ); if ( !empty( $image ) ) { echo $image; } else … Read more

thumbnail crop not working

There are 2 things in your case to consider: Your link contains s3.amazonaws.com… – this means that your site might be using a cdn. Are you completely sure that it is configureв and working as intended? I just reviewed my code and I don’t hook add_image_size inside functions.php to any action. Could you try to … Read more

How to reduce unnecessary thumbnail creation?

You can use a plugin for this. If you want to do it by writing your own code, you may use remove_image_size(). add_action(‘init’, ‘wpse325870_remove_plugin_image_sizes’); function wpse325870_remove_plugin_image_sizes() { remove_image_size(‘small-A’); } Note that you cannot remove reserved image sizes using this function.

Exclude Multiple Post Thumbnails From Post Attachments

$thumb_id = get_post_thumbnail_id(get_the_ID()); $bg_id = MultiPostThumbnails::get_post_thumbnail_id(‘work’, ‘background-image’, $post->ID); $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ => $post->ID, ‘exclude’ => array($thumb_id, $bg_id) );