• Resolved greencode

    (@greencode)


    I’m wanting to get the “medium” size of image plus add a class of “featured” to the image using the wp_get_attachment_image function but can’t seem to get it to work.

    I’m using this (the get_sub_field is calling the image from the Advanced Custom Fields plugin – which is working perfectly at calling the image)

    <?php echo wp_get_attachment_image(get_sub_field('slider_image'), 'medium featured'); ?>

    This is just bringing in the uploaded version of the image and not the medium version. If I remove the “featured” from this string then it brings in the medium image.

    I’m sure this is something very silly that I’m doing wrong but any help here would be greatly appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_get_attachment_image size and class issue’ is closed to new replies.