Closed alihs closed 9 years ago
Yup you can use it directly, although now the only thing you need to do is a require_once
. Nothing else :)
what would be the call function like earlier it was
$params = array( 'width' => 960, 'height' => 380, 'crop' => true ); echo "<img src='" . bfi_thumb( $image[url], $params ) . "'
will it be the same now?
Nope, that's the old usage. This now conforms with the WordPress methods,
so instead of echoing out the image paths, it's advisable to use WordPress'
image functions to display images. Like wp_get_attachment_image
&
the_post_thumbnail
If you include OTF, then use those functions to provide the image sizes, images would get resized automatically.
On Mon, Jan 26, 2015 at 8:05 PM, alihs notifications@github.com wrote:
what would be the call function like earlier it was
$params = array( 'width' => 960, 'height' => 380, 'crop' => true ); echo "<img src='" . bfi_thumb( $image[url], $params ) . "'
will it be the same now?
— Reply to this email directly or view it on GitHub https://github.com/gambitph/WP-OTF-Regenerate-Thumbnails/issues/1#issuecomment-71451360 .
hmm, no there is now no way to call it directly. I ask cause what the earlier plugin helped me to do was resize images on the fly for different sections without using the functions/media settings to resize. Also in coalition with plugins like get-the-image bfi used to be very helpful.
Can it be considered to make the plugin work out of the default function or using BFI would be the best option?
You can still do all of those: wp_get_attachment_image_src Then pass on the width & height in the $size
parameter.
Right now I'm about to launch a WordPress theme. I have this in my functions.php:
add_image_size( 'feature-large', 920, 450, true );
Then I'm just using the size in my content:
the_post_thumbnail( 'feature-large' );
This would work as well:
the_post_thumbnail( array( 920, 450 ) );
Aah, I forgot that function existed. I'll try it out sometime soon and come back if I have any suggestions, questions and ideas. Thanks
No problem! :+1:
can we use it directly in the theme, something like http://alihussain.me/blog/how-to-make-the-get-the-image-wordpress-plugin-to-work-with-bfi-thumb/