wp_get_attachment_image not working with get_sub_field (ACF) (2 posts)

  1. Spencer Hill
    Posted 1 year ago #

    I'm using the Advanced Custom Fields Plugin function get_sub_field to pass the URL to wp_get_attachment_image but it's simply returning blank:

    $url = get_sub_field( 'profile_picture' );
    echo wp_get_attachment_image( $url, 'full' );

    PS I can't post in the ACF forums here because they're not monitored and I can't on the official website because something is wrong with my account so I can't sign in anyway. So please don't bother scolding me for not getting support there.

  2. Daniel Zimmermann
    Posted 1 year ago #

    This can't work because wp_get_attachment_image waits for an ID not an URL.

    But I am also looking for solution for this.

Topic Closed

This topic has been closed to new replies.

About this Topic