Posts archive

Sorting WordPress Posts Using Surnames

A client recently requested that their ‘Members’ page be sorted by surname and not first name. The lists were generated using the follwing code: <?php$cat_args = array( ‘sort_column’ => ‘post_title’, ‘order’ => ‘ASC’, ‘parent’ => 12); $categories =   get_categories($cat_args); foreach($categories as $category) { echo ‘<ul id=”member”><li><h3>’ . $category->name.'</h3></li>’; $post_args = array( ‘numberposts’ => 50, […]

Tags: , ,