Tag Info

New answers tagged

0

What you want to do isn't possible from functions.php or a plugin. The code you have posted would need to replace code in your template files for the page displaying your images. If you can modify the template files, find where in your template generates your image HTML and then you can replace it with something similar to the code you have posted. It's ...


0

You can also go with aq_resize function. There are second and third arguments are given for size, so you can give any size that's you want. Even you can also set these size using shortcode. Check how to pass arguments to shortcode and pass using shortcode if want to fetch dynamic size for each time function thumb_medium( $atts, $content = null ) { ...


2

I think your code is very close, try to use wp_get_attachment_image_src() instead: function thumb_medium( $atts, $content = null ) { // return wp_get_attachment_url( get_post_thumbnail_id( $post_id, 'medium') ); global $post; $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium' )[0]; if ($thumb_url) { ...


0

I had problems using the example from the accepted answer, so re-wrote it a bit, jJust in case anyone should need a working example, not dependant on thumbnail size replacement, which also disables the default PrettyPhoto action. $(".thumbnails").find("a.zoom").unbind('click'); $('.thumbnails .zoom').on('click', function(e){ console.log( $('.thumbnails ...


1

luckily I found the answer shortly after posting this question. My thumbnail size setting (Settings/Media) was 150 x 150px - cropped. So when I displayed them on my page, desktop size, in a row of 4, the thumbnails were getting stretched to 282 x 282px. I changed it to this new size and used a Rebuild Thumbnail plugin and it looks great now. It scales down ...


0

Thanks to the answer given by Rarst, I was able to find this in the Wordpress documentation... function get_image_sizes( $name ) { global $_wp_additional_image_sizes; $sizes = array(); $get_intermediate_image_sizes = get_intermediate_image_sizes(); // Create the full array with sizes and crop info foreach( $get_intermediate_image_sizes ...


0

If you take the look at the source of the function is simply stores the arguments in $_wp_additional_image_sizes global, with key by name. As far as I remember there are no dedicated API functions for it (get_intermediate_image_sizes() will return list of names, but not data). Just access the global and look for data you need by key.



Top 50 recent answers are included