can you try changing these lines:
'order_by' => 'custom',
'meta_key' => 'Last Name',
in each of the above sections with this code:
'meta_query' => array(
'relation' => 'AND',
'last_name_sort' => array(
'key' => 'last_name',
'compare' => 'EXISTS',
),
'first_name_sort' => array(
'key' => 'first_name',
'compare' => 'EXISTS',
),
),
'orderby' => array(
'last_name_sort' => 'ASC',
'first_name_sort' => 'ASC',
),
(this is assuming that your first name key is ‘first_name’)
Related Posts:
- How to add a new product type on woocommerce product types? [closed]
- Updating WordPress overwriting customization tweaks – strategies?
- How to customize the default HTML for WordPress Attachments
- wp_trim_words() does not trim the_content() in WordPress
- page_template toggle between 2 templates + 2 permalinks for same post
- Make page template that is just an “include” of another?
- Custom php file in wordpress
- Selecting An image from the Media LIbrary on the frontend
- WordPress Template not affecting the working, keeps defaulting to the index.php template
- Recommend an open source, template driven website builder UI that produces a working WordPress site [closed]
- For custom templates, is it better to use `template_include` or `type_template`?
- Create default_content layout template based on post id
- Remove template drop down for certain pages
- How do I add a new template to my site
- How to customize core admin pages within a theme?
- How can I make site-wide content editable, for example footer content
- Query post for ‘selected category’ in archive.php
- Showcase elementor templates
- How to get custom page template being edited in gutenberg editor
- Make custom page look exactly as homepage
- Best practice – pages – ACF or inline coding
- Set Title from Custom Template
- How to hook up search results page to a back-end page?
- How To Load an HTML File As A WordPress Page (With No 301/No Redirect)
- Is there a way to by-pass the pagination function on one custom template?
- WordPress archive index page
- How to add custom ‘layout’ buttons to wordpress editor?
- How to create custom layouts and static pages in themes for clients
- Custom Content Page
- Create a Page template selector page
- Creating custom page template
- Force WordPress to load a specific template
- Dynamic Sidebars based on page name
- Translate custom template with WPML
- How To make Custom page of every Category
- why won’t my custom css load with the enqueue method or any other method?
- Conflict between Yoast SEO and my custom theme
- How to add a template – so that i can choose a different menu for some pages
- How can I delete the word `Category:` from page titles? [duplicate]
- How can I add category variable inside posts?
- Why does a custom php code inside a custom template not get executed?
- wordpress custom posts page not showing
- How do I target this page specifically?
- How to use a custom playlist template:
- Still desperate about multiple TinyMCEs in widgets – is there any good solution to this yet?
- Displaying Child Page’s Information
- Getting a jQuery library to work in WordPress & Avada
- Use another theme template in my theme
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Allow arbitrary text after page URL
- Taxonomy template by post type
- Best way to create a page outside of the pages list
- Template setting is not saving in wordpress
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- Custom single page based on which custom page template is selected
- Single page template
- Adding css and js to a blank page created with custom template
- Modifying a local template
- Custom template not working for existing pages [closed]
- How to apply styles to the custom page template
- Create a page for each database table entries
- How to edit the new user email notification template
- Update widget form after drag-and-drop (WP save bug)
- Need help with friendly URL’s in WordPress
- How to add checkbox and radio button in Profile Page
- Can I disable the auto complete?
- Is it possible to have two different previews of a post (ie. two templates for one post)?
- Custom Login and Registration form in Ajax
- Changing editor-style.css style
- Customize the WordPress Default Gallery Output
- Programmatically (PHP) get the nr. of items in the primary navigation menu
- Create a free scripts and styles template within a plugin
- How can I setup a wordpress site with multi country & multi lingual support
- 1 WordPress installation with 2 pages: every page gets a separate domain
- How to customize and keep things up-to-date?
- Problem with custom user meta field
- What are “best practices” for wp-config.php
- What happens to the mu-plugins folder when you upgrade to WordPress 3?
- digital alarm clock widget
- In WordPress 3.x, I can’t access posts from all blogs in the network
- WordPress Install Issue, Receive Warnings But Successful Install
- how to make a custom field readonly or disabled by user role?
- How to make wordpress use a non-wordpress users table?
- Allow multisite admins only to create users with one specific user role?
- Create a custom admin panel
- I want to embed mystream video in my wordpress site
- Current menu item highlights wrong
- Measure time in ONLY HOUR format
- How can error pages be customized
- adding a custom time class to in theme twenty sixteen
- SAving PHP in custom wordpress option field
- Does WordPress support template resources/custom fields
- Remove Twenty Twelve themes responsiveness in Internet Explorer
- Looking for a way to take readers to random post when clicking a link
- Custom Import with taxonomies
- Consolidate ‘add-to-cart’ buttons into one ‘add-all-to-cart’ button
- Update to WordPress 4.9.2, but have heavily customized theme
- Storing form data into wordpress database [closed]
- Display Published Posts Count for Time Period
- How to create a second Super Admin or Super User via MySQL DB