Support

Account

Home Forums Backend Issues (wp-admin) Adding custom field as link for featured image

Solved

Adding custom field as link for featured image

  • Hi,

    I’m trying to add a hyperlink to my featured image using advanced field. Everything else is fine but I cannot figure out the correct format to make the custom field a hyperlink. See below what I tried. It’s outputting the custom field but not making it a hyperlink. for the image.

    printf( '<div class="pdf-cover"><a href="' . the_field('my-custom-link') .'" title="%s">%s</a></div>', the_title_attribute( 'echo=0' ), $img );

    Any ideas?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.