Support » Plugins and Hacks » wp_get_attachment_image not working with get_sub_field (ACF)
2 years, 9 months 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 years, 8 months 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.