• I have a block using a repeater child controls, but I can’t figure out any way of getting a smaller image other than the full resolution one?

    Looking at Lazy blocks docs it should be something like
    <?php echo esc_url( $inner[‘image’][‘url’],’Medium’ ); ?>
    but doesn’t do anything, returns full hi-res image

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author nK

    (@nko)

    Hey.

    Look at the second example Accessing image by ID -> https://lazyblocks.com/documentation/blocks-controls/image/

    Regards, nK.

    Thread Starter hellothereuk

    (@hellothereuk)

    Sorry doesn’t work for me, the code just errors Undefined Index instead of returning image URL:

    echo wp_get_attachment_image( $attributes['team-image']['url'], 'medium');

    or

    echo wp_get_attachment_image( $attributes['team-image']['id'], 'large')

    both return:

    <b>Notice</b>: Undefined index: team-image in <b>#######/wp-content/plugins/lazy-blocks/classes/class-blocks.php(1192) : eval()’d code</b> on line <b>30</b><br />

    if use the normal method on ‘team-image’

    echo esc_url( $attributes['team-image']['url'] );

    it returns the correct image URL, so ‘team-image’ is correct

    • This reply was modified 4 years, 2 months ago by hellothereuk.
    • This reply was modified 4 years, 2 months ago by hellothereuk.
    • This reply was modified 4 years, 2 months ago by hellothereuk.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to get other image sizes in Repeater’ is closed to new replies.