Question about how to reference an absolute URL, not a relative one
-
Hi,
I have created a custom field called ‘article-url’ using the ACF plugin. For this field, each entry has a ‘value’ and a label’ (For example one value would be: https://www.time.com, and the label would be ‘Time Magazine’).I am trying to display the field label on the frontend, which also links to the field value, when the user clicks on it (So, my website would display ‘Time Magazine’, which would link to ‘www.time.com’)
I have used the following code:
<strong>Source of this article:?</strong><a href="[field article-url]">[field article-url out=label]</a>
However, the problem is that when I click on the label on the front end, it leads me to https://wwww.mywebsite.com/www.time.com, rather than just https://www.time.com. In other words, it assumes my article-url is relative to my website. How do I change this to an absolute url?
https://www.ads-software.com/plugins/custom-content-shortcode/
- The topic ‘Question about how to reference an absolute URL, not a relative one’ is closed to new replies.