Hi J,
You should be able to do exactly what you’ve said and change the line you reference, but replace ‘original’ accordingly. I’ve tried it here on a development site and it worked as expected.
There must be something else at play. Maybe a caching plugin? File not being uploaded after making the change? etc.
Steve
Would this only affect images uploaded after the change? All the images on the site have the necessary sizes generated.
Will also see if anything is being cached.
Thanks,
J
“Would this only affect images uploaded after the change?”
– No. Should kick right into effect.
Steve
Regenerated all the thumbnails and disabled any caching plugins but the problem persists:
http://test.blackhay.co.uk/property/troon-ka10/
Here’s the full code from my property-images.php page:
<?php
/**
* Single Property Images
*
* @author PropertyHive
* @package PropertyHive/Templates
* @version 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $post, $propertyhive, $property;
$gallery_attachments = $property->get_gallery_attachment_ids();
?>
<div class="images">
<?php
if ( !empty($gallery_attachments) ) {
echo '<div class="slider-for slick-slide-img--full">';
foreach ($gallery_attachments as $gallery_attachment)
{
$image_title = esc_attr( get_the_title( $gallery_attachment ) );
$image_link = wp_get_attachment_url( $gallery_attachment );
$image = wp_get_attachment_image( $gallery_attachment, 'large' );
echo '<div>' . apply_filters( 'propertyhive_single_property_image_html', sprintf( '<img src="%s" alt="Placeholder" />', $image_link, $image_title, $image ), $post->ID ) . '</div>';
}
echo '</div>';
} else {
echo apply_filters( 'propertyhive_single_property_image_html', sprintf( '<img src="%s" alt="Placeholder" />', ph_placeholder_img_src() ), $post->ID );
}
?>
<?php do_action( 'propertyhive_product_thumbnails' ); ?>
</div>
Thumbnail support is added via my theme’s functions file, if that matters.
In the link provided the original images uploaded are only 1000px wide to begin with so, even if you request large, your going to get the original.
What happens if you change ‘large’ to ‘medium’ or ‘thumbnail’?
Steve
Nothing happens – original image is still loaded, here’s one where the orig is 2000px:
http://test.blackhay.co.uk/property/prestwick-ka9/
I have large defined as max. 700px so even if it’s 1000 it should still be resized?
Jonny
On that link I’m seeing the large version (i.e. 700px wide) being used now.
Steve
Hi Steve,
It was the apply_filters that was messing everything up, wasn’t calling the $image variable so the size wasn’t being applied.
Thanks for your help.
J