Tag Info

Hot answers tagged

1

This function will generate an image by temporarily registering an image size, generating the image (if necessary) and the removing the size so new images will not be created in that size. function lazy_image_size($image_id, $width, $height, $crop) { // Temporarily create an image size $size_id = 'lazy_' . $width . 'x' .$height . '_' . ((string) ...


1

If this is still a problem, then you can find my answer on wordpress.org's support forum, it might help: wordpress.org/support/topic/resize-failure-on-some-images-with-odd-message This is a part of a code from the jQuery library, to be specific this part is responsible for handling callbacks. It is displayed, because the reponse from wordpres is ...


1

You can use Adaptive images WordPress plugin. It generates images on the fly and cache them. It gives to settings in admin section in which you can specify your breakpoint ( on which it will generate images ). You can also use Picturefill.WP WordPress plugin.


1

It sounds like your problem occurs before the image is cropped/ resized and displayed in the page - the original image is too small. You can require minimum dimensions for uploaded images, see: How to Require a Minimum Image Dimension for Uploading? Then, to resize the uploaded image without cropping it, define the image size with a 'soft crop' using ...


1

The issue is that when I upload an image that is less than the dimensions 600x339 in either height or width, they show up incorrectly on the page. I did not understand this statement as you wrote it, but when I started researching I found what you meant, so I am writing this answer to document this for others who do not understand your meaning, or how ...


1

Having a solution: First register thumbnail size in function.php add_image_size( 'cp-thumb', 600, 339, true ); // (cropped) Generate thumbnail while uploading image. Then call it in post loop in following way: <div class="outer-div"> <div class="inner-div"> <?php get_the_post_thumbnail( $thumbnail->ID, 'cp-thumb' ); ?> ...


1

You can try to crop the image in places you want manually using the WP_Image_Editor class. Here is a simple example $image = 'http://karunshakya.com.np/wp-content/themes/twentyeleven/images/headers/lanterns.jpg'; $img_size = getimagesize($image); $img_process = wp_get_image_editor( $image ); // Return an implementation that extends ...


1

Having so many images on one page isn't recommended. You should split the images into smaller galleries and across more than one page (or use pagination) to lower the page load speed for each page. To split a single post in several pages (adding pagination) you can just add using the text editor. Alternatively ensure you're image sizes are not too large ...



Only top voted, non community-wiki answers of a minimum length are eligible