Support

Account

Home Forums General Issues how to merge/combine acf image field and link or url field

Solving

how to merge/combine acf image field and link or url field

  • I want to merge/combine the ACF image field and link/url filed so that whenever I choose the image field it will automatically link combined to it, and in some way, is there a way to create a button field, where the same link is hyperlinked to the button.
    I hope I can do this ACF, How can I do this without having ACF Pro.

  • I’m not sure from your description what it is that you are trying to do.

    If you are asking how can you have ACF automatically create images with links and buttons then this is not possible. You need to create the fields and then alter the PHP/HTML/etc in your theme to use these fields.

    An example, let’s say I have an image field that returns the image url and a url field.

    
    <a href="<?php the_field('url_field_name'); ?>"><img src="<?php the_field('image_field_name'); ?>" /></a>
    

    for more information I suggest Getting Started with ACF.

  • Thanks for your suggestion it’s almost solving my problem, let me clear the gap, I have created an ACF Image field and a URL field.
    Instead of the Code part can we link that field group settings itself?
    by selecting the image field and linking it to the URL field? (I have conflicts showing the acf fields from backend)

  • Can anyone please help me out!
    Thanks.

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

You must be logged in to reply to this topic.