Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter lukechemistry

    (@lukechemistry)

    Thanks for the prompt reply!

    I’m a little confused on how I could use wp_get_attachment_image( block_value( 'your-field-name' ) ) with an img element.

    <img src="<?php wp_get_attachment_image( block_sub_field( 'image' ) ); ?>"> is pulling in only the img src. I need to be able to call the image and pull in the src and alt text within an img element.

    I also tried this <img src="<?php block_sub_field( 'image' ); ?>" alt="<?php get_post_meta( block_sub_field( 'image' ), '_wp_attachment_image_alt', true ); ?>"> but its pulling in the URL instead of the alt text.

    Thanks for any help!!

Viewing 1 replies (of 1 total)