Not sure if this help. If you use normal wordpress loop to query post or pages then you can do this by using query_posts
You need to place a line of query_posts before the loop start and it might look something like this ( you might need to add some more parameter for getting only pages in your case )
query_posts($query_string. '&order=DESC&orderby=meta_value&meta_key=last_name')
Ref: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
Related Posts:
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Orderby meta_value only returns posts that have existing meta_key
- ORDER BY custom field value
- Auto sort the wp-admin post list by a meta key
- get_pages sort alphabetically by meta value
- Archive sorting functions by custom fields (front-end)
- Order by custom field date?
- How can I sort get_users() by any value (last_name, user defined fields and more)
- Is it possible to order posts by two meta values?
- Sorting posts by multiple values, combined
- Sort by posts that have a featured image?
- sort search results by custom fields using dropdown
- Sorting posts ordered by custom field value
- Sorting WordPress Posts via Custom Field Values?
- Advanced search by two criteria – sort by location and date (ascending or descending)
- Change the sort order for posts to include custom field
- Sort custom post type by multiple custom fields
- Sort alphabetically by custom field
- Trying to sort and display categories(not posts) by custom field: ‘order’
- Sort WP_Query with numeric custom field
- ORDER BY custom field value out of where clause
- wordpress custom loop ascending descending posts by custom field
- Select custom posts by meta_value and sort by a different meta value
- change order of images attached to post
- Sort posts by clicks on download button
- How To Show Get Adjacent Posts If Posts Are Sorted By Custom Field
- Listing the most popular 8 city (custom fields) as used in posts
- How to sort by custom field value?
- Custom Query Fields – Altering Meta Value
- How to order posts by number of Vimeo Likes
- Filter or order based on custom field
- Compare ACF date field (if exists) and post date and order DESC
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Sort posts by custom fields with empty values
- Sort custom fields in admin by last field added
- Sort posts after filtering them through multiple taxonomies
- Can’t sort custom column on user.php by number / meta_value_num?
- Order by a meta field in query loop
- Custom Taxonomy Template Post List with Sort Order
- Can serialized arrays in DB be matched against serialized arrays with meta_query?
- Create a select drop down of available menus
- copy attachments to another post type and change attachment url
- Cannot edit post meta fields with rest API
- Only display custom field if it there is a value inside
- Slow meta query with multi meta keys
- Custom Field Multiple Clauses
- Custom field values repeating
- Send Multiple Custom Field Values Through the URL
- $wp_query meta_key naming issue [closed]
- Meta_query and numeric comparison [closed]
- Separate table or usermeta
- Woocommerce with metabox plugin
- using multiple meta_key and meta_value in query_posts
- How Meta Data is different from Custom Fields of POST/PAGE in WordPress
- Sorting custom post type columns with external data and without meta values
- global function to apply filter to custom field
- How to add a new meta key and assign timestamp to posts
- Print custom field in Query Loop block
- Is there a simpler version of WP Media?
- Order RSS content by an advanced custom field value
- UPDATE on SELECT results. A SQL query to swap Author with Meta Box value
- Alter main archive, to show posts with meta as last
- Add microdata from schema.org [closed]
- Displaying multiple URLs as custom field values
- Collect user custom field in product page woocommerce
- How can I save custom meta to one global value?
- get posts where a custom field contains a text
- Displaying a custom field
- How to use media upload on metabox post page without breaking TinyMCE?
- User customising position of WordPress Featured Image
- Insert image into sub-field with update_post_meta
- How to Pass values to Custom Field through PHP in WordPress Posts?
- How to use conditional statement with custom field
- Custom field php
- SQL: Select wordpress posts with given text string and add a custom field to them?
- how to add product subscription field in woocommerce plugin
- How can I change the publish date based on a custom field?
- Is it possible to use get_post_meta() to control HTML?
- Editing custom fields for comments
- Getting and calculating averge value of custom fields of the same tag
- Automatically Add Custom Fields Value as Tags
- How to speed up post list slowed by update_meta_cache()?
- Custom Field URL + description
- Retrive acf fields in publish_post action for wp_mail
- Issue on Creating Checkbox Field On Custom Post type
- Update custom field on page specific to logged in user
- Get link picker custom field to show only if field exists
- Save input form on custom field
- Admin – Search Events by a custom field
- Paying to Access Custom Fields Per Post
- wp_postmeta are updated for only one page
- How to add a prefix to existing custom fields over MYSQL query?
- Complex WP_Query Using Post Date And Post Meta
- Upload image to wordpress
- I want to add a custom field in the rss title of each post, but don’t want it to be shown on the site
- Custom metaboxes not saving after switching themes
- woocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19% [closed]
- How can I attach files without using a plugin?
- Change Fields of Comments and make them searchable?
- Truncating characters in Advanced Custom Fields works some places but not others?