How to list custom fields as headers and list all pages sharing that custom field under it?
What you want to do is create a variable that keeps track of the ‘current’ state, then for each post in the loop check if its state is the same as the current state. If it is not then output it and update the current state to the new state. This will have the effect … Read more