All Posts by Email, Once a Week

Media Temple logo

CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.

Retrieving the Attachment ID

  • # January 3, 2013 at 11:48 am

    @chrisburton Thanks a bunch bud!!!!! I saw that SE question last night, but obviously I was too tired to process.

    This seems to work:

    $attachment_id = get_sub_field(‘background_photo’);
    $image_attributes = wp_get_attachment_image_src( $attachment_id, $size );
    echo $image_attributes[0];

    # January 3, 2013 at 11:58 am

    Awesome. Glad you solved it.

Viewing 2 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed