Conditional Formatting Question
-
I love this plug in. I am trying to display the content of taxonomy fields as a list of items separated by commas. I have a [loop] to display each post of a custom type, then a [for each] to iterate through each taxonomy field like so:
[loop type="art_submission"] Title: [field title] Description: [field description] Worktype:[for each="worktype"] [each name],[/for] Gallery: [content gallery="native"] [/loop]
The problem with code is that I always get a trailing comma after the last item in the taxonomy list “worktype”:
Title: New Submission #3
Description: This is a description area
Worktype: Photography,I tried some code for a conditional like this:
Worktype:[for each="worktype"][if last] [each name][else] [each name],[/if][/for]
However the
[if last]
only refers to the outer loop, not the each loop. Is there a way to accomplish what I want out of the box or am I going to have to dig into some PHP for the template?
- The topic ‘Conditional Formatting Question’ is closed to new replies.