Troubles with “for each”
-
I have a custom post type called Vehicles. For it, I defined an ACF field called “acf_type” which presents a selection among multiple choices: bike, car, etc.
I’d like to show some identical HTML for each one of these types, grouping them one after the other in the same page. For example:
<div class="title">Bike</div> <div class="description">something something</div> <div class="title">Car</div> <div class="description">something something</div>
To achieve this, I tried the following:
[loop type=vehicles orderby=name] [for each=acf_type] <div class="title">[field acf_type]</div> <div class="description">[field acf_description]</div> [/for] [/loop]
but I obtain nothing. I either misunderstand the purpose of “for each”, or I’m doing some mistakes with the syntax.
Any help would be greatly appreciated.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Troubles with “for each”’ is closed to new replies.