As far as I know, you can’t actually publish a post without a title. WP might erroneously say your posts are published, but I’m pretty sure they’re still viewed as drafts, which is why you don’t get any post results.
First, make sure your custom post type supports your custom field:
$args = array(
'post_type' => 'people',
'posts_per_page' => 40,
'meta_key' => 'surname',
'orderby' => 'meta_value',
'order' => 'ASC',
'paged' => $paged,
'supports' => array( 'title', 'editor', 'custom-fields')
);
Then, you could auto populate the title or create it from meta data:
Related Posts:
- Order by & include array by specific post ids
- ascending order custom post type
- Display custom post types with custom date field value (before today) & order by custom date field
- How do I query a custom post type with a custom taxonomy?
- Adding ‘menu order’ column to custom post type admin screen
- what is the correct way to compare dates in a WP query_posts meta_query
- Custom post type – order field
- How to get post content by calling ajax?
- How to show all posts of the category in wordpress?
- Get the ID of the latest post
- Using meta_query, how can i filter by a custom field and order by another one?
- Return all custom meta data for one custom post type
- Display a query with multiple post types and same relationship on a single page
- Displaying a custom post type alphabetically
- Fail to compare dates in meta_query
- How to filter custom posts by tags and custom fields?
- How to call a custom post with get_posts() instead of query_posts()?
- Custom post type archive 404’s with paginate_links
- Sort Order for a Custom Query in a Post Type Archive Not Working
- Select All in Parent Category, Group by Child Category?
- Ordering posts having multiple post-meta date fields
- Display Custom Post Type Fields
- Querying custom posts and regular posts
- Loading Custom Post Type Events into jQuery-based FullCalendar?
- Order Posts by Taxonomy and Meta Value
- Limit the post for differents custom post type in the same wp_query
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Custom Post type sort order not working in the admin area
- Retrieving 3 latest post from each of 5 different custom post types
- How to hook get_terms() to only show count of posts that have custom meta
- Using Offset in Custom Post Type Query
- how to group custom post type posts by custom taxonomy terms
- Order posts by (hierarchical custom) taxonomy terms and term children
- order by meta_value serialized array
- Posts per Page on custom Taxonomy Template
- Compare 3 custom fields and sort by oldest
- List upcoming events, ordered by date in a custom field
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to get the parent’s taxonomy?
- Loading post content in FancyBox
- Query posts by custom post type and custom taxonomy
- Multiple templates for custom post type
- Query post types with multiple keys
- posts_nav_link on single post template
- WP_Query post at custom position
- Sort custom post types by last name in the backend
- Query not returning CPT posts
- Post Rank on Single Post page based on custom field
- query order by date on custom type: wrong order
- Taxonomy list. Order by a specific custom post type count
- How to get only one category of custom post type?
- Used with meta_query in query_posts works slowly
- WooCommerce – Show orders for a specific product ? [closed]
- Unable to display multiple post types in same query (WPML WP_Query)
- pre get posts changing the query
- Query for posts in 2 taxonomies
- Prevent change with new query_posts()
- How to make an archive page displaying posts in a date range
- Re-order posts in query after
- Get permalink and title by post name?
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Custom Post Type sorted by Title
- Get all posts WHERE custom_field is LIKE value
- Quickest way to get last or oldest post date – WP Query
- How to display recent posts added in several custom post types
- ‘category__and’ for custom taxonomy?
- Post the content of a specific “Custom Post Type” post within a post using a shortcode
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Custom Post Type order by modified date and custom meta field issue
- reference the current category being used in the category.php page
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- List custom post type by custom tax term as page title
- How to query different post types in specific order?
- query_posts with a custom post type, a meta_query and sorting by post date?
- Custom query shows custom post types in trash
- Multiple post type queries (with specific arguments for each)
- Combine query_posts() and get_posts() into single query
- how can i get posts from custom post type particular taxonomy category
- Setting posts per page in query_posts
- How to insert content from another Custom Post type into Post?
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Sort by custom field is not working
- Custom query works but returns “Undefined Offset: 0”
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- Sorting multiple custom post types without a meta key/value pair by sort order
- Custom post types instead of regular post’s categories in a page template
- Change or update WordPress loop based on dropdown selection
- Combining sorted and random CPT
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- I did group my search results by post type, but how can i give each of them its own order?
- Ordering posts in Search & taxonomy by post_meta
- What’s a better alternative to this code?
- Display custom post type from dynamic custom field
- Query/list all terms and their custom post count
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Rewrite and custom post type: order by custom field not working
- Display only one post each WEEK