Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
1
vote
1
answer
382
views
Image resize depending on orientation?
is there an option or a plugin that resizes an image depending on it's orientation? … Reason for this question:
Im building an image grid and it would look even better when all images would have the same width. …
2
votes
1
answer
2k
views
Generate image size, based on the image-orientation
Orientation
The image can be in landscape, portait or square format. Each has a different max-width. The optimal solution would be to provide a different version for each orientation. … in the requested dimensions allready exists.
// Create an instance of WP_Image_Editor for the original image
$new_image = wp_get_image_editor($image['path']);
// Resize the image …
1
vote
1
answer
3k
views
How to fit image to Thumbnail canvas size?
I need to upload images with a different orientation (portrait and landscape) and I don't want to crop post-thumbnails. But I need always thumbnail size 250x250px. … If I upload a portrait oriented image - it will be resized to 250px height, but the width may be different. …
1
vote
Why can't I edit certain images from the WordPress Media library?
I think this only happens on my images which are taller than they are wide ("portrait" orientation). If the image is wider than it is tall, it gets resized to fit correctly. … on a 410 x 500px image
OK on a 401 x 500px image
Failed on a 400 x 500px image
OK on a 399 x 500px image
Failed on a 400 x 380px image
Seems to only fail when the image is exactly 400px wide
I filed …
1
vote
Accepted
Generate image size, based on the image-orientation
', 10, 1);
/**
* Generates custom image sizes, depending on the image orientation. … if (is_wp_error($new_image)) { continue; }
// Resize the image
$new_image->resize($size['width'], $size['height'], $size['crop']);
// Save new image and store new meta data in variable …