Try:
[for type=all]
[pass field=url]
<li><a href="{FIELD}">[each name]</a></li>
[/pass]
[/for]
-
This reply was modified 4 years, 2 months ago by
polarracing.
That didn’t work. It’s listing all of the post types with a link, but ALL of the URL’s are to the home page and not the archive page.
<ul>
[for type=all]
<li><a href="[each url]">[each name]</a></li>
[/for]
</ul>
This is the result I get
https://www.evernote.com/l/ALGwTuizR6lEs7U6dgJ4AOFfGO8S00IqeRM
The following prints the URL inside of quotes.
<ul>
[for type=all]
<li>[each url]</li>
[/for]
</ul>
See here:
https://www.evernote.com/l/ALH4yo1jMf1DILlEwQgRvxCoS8ccGkVdsL4
If I try the code like this without the quotes on the href like this:
<ul>
[for type=all]
<li><a href=[each url]>[each name]</a></li>
[/for]
</ul>
I get this:
https://www.evernote.com/l/ALFkwNUG2m1D9aK_LYGHio2C_kkql1BayZQ
Any ideas why this happens?
-
This reply was modified 4 years, 2 months ago by
theshae.
-
This reply was modified 4 years, 2 months ago by
theshae.
-
This reply was modified 4 years, 2 months ago by
theshae.
Would you try it with single quotes?
I’ve tried that too. Still not working. Is anyone else getting the same results?
*I hope this would help others as references:
<ul>
[for type=all]
<li><a href=[each url]>[each name]</a></li>
[/for]
</ul>
is wrong if you are posting them through WordPress text editor.
Always pass vars into a functioning attributes of any HTML element.
Correct example that works for me:
<ul>
[for type=all]
[set varurl][each url][/set]
[pass vars]
<li><a href="{VARURL}">[each name]</a></li>
[/pass]
[/for]
</ul>
note: unless you set the ” in the var, otherwise url attribute needs to open&close with ” as it is.
I also avoid using -/_ when naming set vars eventhough it may not be relevant to the errors I got but not using them fixed my problems so I just consider this as a good practise to go.