Support

Account

Home Forums General Issues Image URL

Solving

Image URL

  • I’m using nextscripts facebook poster. I want to post on my facebook with a custom image specific for facebook and what is not used in a post.

    I created with ACF a image field for post. so I can select a image for each post which I want to use with nextscripts.

    Nextscripts needs a custom field with a image url.

    How can I get the image url of de ACF image in a custom field?

  • Image fields in ACF store the attachment ID in the field. If you need to have the actual URL stored in the field then you should probably use a URL field and paste in the URL of the image that you want to use.

  • I also tried this, the url is the result then. But it’s not working with SNAP, I filled the custom field name in SNAP (Nextscripts), but it give error then.

    Do I need to fill something special in custom field nextscripts for featured image?

  • I did some little more checks.

    When I create a ACF field “FILE” then the result on frontpage is the url of the selected image file, but it’s not working with Nextscripts autoposting.

    When I create a ACF field “TEXT” and paste the url of the image then it is correct posting the image file with Nextscripts .

    So I’m looking for a solution that the URL of the image after select ACF field “IMAGE” or field “FILE” the url of it is autoposted in the “TEXT” field.

    Because we don’t know the exact image location and first want to select or upload a new photo to the post , before the correct URL is known.

  • ACF stores both Image and File fields as the ID of the media attachment.

    In order to put the URL into a field you’ll need to create another field to hold the URL, like a text field. Then you’ll need to create an acf/save_post filter, this is outlined here: http://www.advancedcustomfields.com/resources/acfsave_post/.

    You’re filter will need to retrieve the ID value and convert it to a URL and then update the text field.

  • Hmmm, how to do this.

    Just add this code in my functions file.

    Can you be more clear for what to do?

  • Sorry for the delayed reply on this. I did not get a notification that you had replied. Hopefully you didn’t give up.

    The main problem is that ACF stores uploaded image field as the image ID value. The plugin that you’re using expects the database to hold a URL and it’s finding an ID instead.

    There are 2 choices, use a text field or a URL field and then find and paste in the URL or some coding.

    The coding involved is what I said above, set up your image field to return the URL of the image. In you function.php file create a save post action function. In this function you get the field from the ACF image field.

    $srch = get_field('image_field_name')

    Then insert the image URL into another field

    update_post_meta($post_id, 'image_field_name_for_plugin', $value);

    Then you can use the new field name for the plugin that needs the URL of the image.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.