Shortcodes not working inside links
-
This has been mentioned in an earlier post “Shortcodes not working inside“. Here are some workarounds that worked for me.
Does not work:
<a href="[field URL custom=true]">Go to Website</a>
Does not work:<a href='[field URL custom=true]'>Go to Website</a>
Does not work:<a href="[field URL custom=true]">Go to Website</a>
Does not work:<a href="[field URL custom=true]">Go to Website</a>
Works:<a href=[field URL custom=true>Go to Website</a>
Notes: Quotes around URL removed.
URL is a custom field, hencecustom=true
This may have an issue if the given URL contains a “space”, although this should be escaped as%20
Setting a variable also does not work.Title and image links
You don’t need to build your own link if you use
[field title-link]
and[field image-link]
.Custom Content Shortcode could create its own workaround, something like:
[field URL makelink]
to generate , or
[field URL makelinkshort]
to generate<a href="URL"
(unclosed so that parameters can be added)
- The topic ‘Shortcodes not working inside links’ is closed to new replies.