Website link via ACF

Hi there,

When using ACF to populate a url link it’s giving an error.

Here is the code:

<b>Website:</b> <a href="[cs_acf field="website_address_of_place"]">[cs_acf field="website_address_of_place"]</a>

Please advise a fix

Kind regards,

Hi there,

Thanks for writing in.

Please try this one,

<b>Website:</b> <a href='[acf field="website_address_of_place"]'>[acf field="website_address_of_place"]</a>

The issue is adding double quotes to double quotes.

Thanks!

I have replaced the code with what you sent, but it just breaks the page.

Hi There,

Please do give us wordpress and FTP credentials so we can check your setup.
If you are adding the field directly on single page template, see this guide:

Sure, see the note.

Hi there,

There seems to be an error on your site that is coming from wp-single-places.php and the codes in the file seems to be messy.

Since you are adding the field directly to the php file, try using the_field() function like this:

Kindly read through the guide here as previously provided by @Lely.

Hope this helps.

Hi Jade,

If I remove the <a> link the page loads fine. I just need to hyperlink the the acf field. Placing in the php directly still breaks the pages as the code is placed within the [cs_content] tags.

Please advise.

Hi there,

I can’t check your template codes anymore, looks like you changed the FTP login credentials. But, you’re just adding this to a template file

<b>Website:</b> <a href="[cs_acf field="website_address_of_place"]">[cs_acf field="website_address_of_place"]</a>

Then you can try it something like this

<b>Website:</b> <a href="<?php echo do_shortcode('[cs_acf field="website_address_of_place"]'); ?>">[cs_acf field="website_address_of_place"]</a>

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.