Sorting pages by a custom field
-
So in my sidebar I am listing my pages:
<?php wp_list_pages('title_li=<h2>Your City</h2>' ); ?>
Pretty simple however, what if I have a custom field on every page and I want to sort based on that custom field.Example. I have 150 cities as page. Each City has a custom field called state. I want to sort it alphabetically by state then city.
Next I want to indent all the cities. Normally this would be simple in php but I’m not sure where all the data is and how to do this with php
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Sorting pages by a custom field’ is closed to new replies.