Dynamic URL data, pulling through, but not creating a link on archive layout

I have AFC enabled. Have successfully installed a url field to users (external page, sort of an affiliate link).
I can successfully pull that data url and display it as text to all types of pages.

PROBLEM: I can’t pull it in as a as a link, a button or even raw text with <a href=… to my ARCHIVE layout.
It seems that Cornerstone is blocking it and not rendering that URL on the backend. The URL is not visible at all when viewing source.

It pulls in fine as a URL to regular posts and pages. The link is active.

The only difference is it being an arhive layout.

MY SOLUTION: To build the archive layout as a single page layout. Hopefully that solves the problem.

MY QUESTIONS:

  1. Why is it not working on archive layouts?
  2. Why should I even consider using Archive layouts for anything if they behave this odd - as a single layout will get the job done. (hopefully)?

Hey @marcuszacco,

Regretfully, I can’t answer your questions without knowing some more details like how are you exactly getting the ACF field in your archive layout.

With that said, please provide the following info in a Secure Note

  • Name of the Archive Layout
  • What element you’ve set to display the ACF field?
  • WordPress Login URL
  • Admin username and password

You can find the Secure Note button at the bottom of your posts.

Thanks.

Hello @marcuszacco,

You are using this ACF dyhnamic content{{dc:acf:user_field field="atg_url" user="author"}}{{dc:acf:post_field field="spel_nummer_url"}} in the Button element as the Link URL.

The button URL is correct and should be working. The problem is that because your column or the Post element is using the <a> HTML tag, the button element does not work. You cannot nest <a> HTML tag.

To get this resolve, edit your layout and change the HTML tag to use <div> only.

Kindly let us know how it goes.

Perfect! That was it. I changed it to a div and it works now. Thank you. Makes total sense.

I even thought it might of been the <a tag since I used the original template on the Archive pages BUT I didn’t find it at the time I was looking for it - so I had already discarded that. So clumsy.

Thank you very much for solving the issue.

You are most welcome, @marcuszacco. Please feel free to create another thread if you need any other information.

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