Hi
I have created a custom post type called Projects and have been able to create the following loop to display a list of ALL posts:
<Loop type=project orderby=date order=desc>
<a href="{Field url}" alt="{Field title}"><Field image /></a>
<h4><a href="{Field url}" alt="{Field title}"><Field title /></a></h4>
<p><Field excerpt /></p>
</Loop>
but I would also like to display lists of projects on the basis of custom fields I have set up in the custom post:
-
I have created a true/false field type with the slug ‘featured-project’ and would like to create a template that only display posts if the field is ticked (ie, true)
-
I have also created a text field type with the slug ‘project-country’ and would like to create a template that only display posts of one particular country.
I’m guessing (but am not convinced this is right!) that I would start by adding the field name to the loops, like this:
<Loop type=project field=featured-project orderby=date order=desc>
<Loop type=project field=project-country orderby=date order=desc>
but I can’t work out how to specify ‘true’ for the first option and a specific country for the second option.
I hope that all makes sense!
Thank you for any help you can give (or if you have a better way of achieving the desired end result)