junaidbhura / fly-dynamic-image-resizer

Fly Dynamic Image Resizer plugin for WordPress
https://wordpress.org/plugins/fly-dynamic-image-resizer/
MIT License
161 stars 26 forks source link

Possible issue with dynamic images #37

Closed NSDesign closed 4 years ago

NSDesign commented 4 years ago

Hi

I had some trouble using the image size name when creating images ion the fly.

$image = fly_get_attachment_image_src( $ID, 'img_name', array( 500, 500 ), false );

However, once the name was removed it worked as expected.

$image = fly_get_attachment_image_src( $ID, array( 500, 500 ), false );

Thanks for your work on this, very nice.

junaidbhura commented 4 years ago

Hi @NSDesign thanks, I'm glad you find this plugin useful!

Looks like the first line of code is incorrect: https://github.com/junaidbhura/fly-dynamic-image-resizer/wiki

You can either pass the name or the size, not both.

So it would be either:

$image = fly_get_attachment_image_src( $ID, array( 500, 500 ), false );

OR

$image = fly_get_attachment_image_src( $ID, 'img_name', false );

Hope that helps! :)

NSDesign commented 4 years ago

Hi Junaid Thanks for the feedback

Your example on the page below shows using the name and size. https://github.com/junaidbhura/fly-dynamic-image-resizer/wiki Example 2: Dynamic Image Sizes

<?php $image = fly_get_attachment_image_src( get_post_thumbnail_id(), 'home_page_square', array( 500, 500 ), true ); echo ''; ?>

Cheers

On Tue, Jun 23, 2020 at 4:19 PM Junaid Bhura notifications@github.com wrote:

Hi @NSDesign https://github.com/NSDesign looks like the first line of code is incorrect: https://github.com/junaidbhura/fly-dynamic-image-resizer/wiki

You can either pass the name or the size, not both.

So it would be either:

$image = fly_get_attachment_image_src( $ID, array( 500, 500 ), false );

OR

$image = fly_get_attachment_image_src( $ID, 'img_name', false );

Hope that helps! :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/junaidbhura/fly-dynamic-image-resizer/issues/37#issuecomment-647933955, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBJDBHNA7Y73WGTKIOVWZ3RYBCP3ANCNFSM4OFGIN3A .

-- Nicholas Sullivan Design

junaidbhura commented 4 years ago

Thanks for pointing that out @NSDesign ! I've updated the wiki, sorry about that!