as ChrisL said in the comments, you should add order and orderby to your arguments :
$args = array(
'post_type' => 'totem',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC'
);
Related Posts:
- Automatically adding meta data to posts or multiple query help
- Display post content with respect to its title?
- Query Custom Post Types with checkboxes
- Pagination not working with custom loop
- Get the ID of the latest post
- Get list of all registered post types slugs
- Sort custom post type list table by display name of a user id stored as post meta value
- get attachments for all posts of particular post type
- Custom Queries: Joining On Meta Values From Two Custom Post Types
- Limit the post for differents custom post type in the same wp_query
- Querying Posts by Taxonomy From Alternate Network Site
- Query posts between two dates (custom meta keys) CMB2
- Include different loop templates in search query
- Adding posts of custom type into the main feed
- Custom Select Query with Custom Post Types
- WP_Query search posts by custom post type and custom taxonomy
- Calculating Bayesian average for custom post type
- Selecting New & Edit Page for Custom Post Types
- How to filter custom taxonomy categories on archive?
- Modifying date filter on admin page for custom post type to link to custom field
- How to debug a blank page?
- query posts and custom post type with meta key
- WordPress Orderby Numeric Value Not Working
- Create a post in custom post type using field in registration form after users submit form
- Query string parameters from custom fields, inconsistent results
- My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
- Add post_type to index.php
- Order By Post Type ThenBy Taxonomy
- Custom query to filter posts that have current post as a taxonomy [closed]
- Custom post type redirected to homepage – how to debug
- How to modify archive query with pre_get_posts to append CPTs?
- convert custom query to wp_query
- Making certain categories of CPT not publicly queryable
- Get parse_query filter to return slug instead of id
- Querying both pages and posts
- How do I move/order posts with a tag to the end?
- Specific query for custom post type
- First custom field value (out of several) displayed twice after query
- Prioritize posts in query by meta keys?
- WP_Query orderby and tax_query
- Displaying Posts from Custom Post Types
- Different Ways to Query Custom Post Types?
- How to organise this data within WordPress
- Custom Post Types — $args vs. labels array
- Number of posts in the archive
- How to query 2 custom post types that need to share a slug?
- Add first letter of titles to array, then compare arrays
- WP_Query() with custom post type and taxonomy — get all terms?
- Query custom post type based on post id and custom field value
- Listing custom post types on archive page with array
- Inefficient Query Confusion
- Querying multiple values from a single key
- How to conditionally add Custom Post Type to Front Page
- Graphql: Unable to query (where:{author}) for custom post type
- Query not work for current taxonomy
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Custom Post Type setup
- new WP_query > displays posts only once instead of running through full array
- Pagination on search results page
- How do I disply an array inside a custom post type?
- Hide text if query has no posts
- Filtering custom posts by custom fields (ACF) [closed]
- Custom taxonomy query showing more than 4 posts
- All in one calendar custom post type query doesnt work as expected
- How to divide Subcategories into pages of parent category wordpress
- Query filter by value in meta_value array
- Change search query in wordpress custom post type
- WP Query: If field X is empty, show posts based on field Y
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Does this archive template part look like its making too many calls to the db?
- Shortcode with loop stacks output
- Displaying all posts by category and showing content on click
- Meta query and compare “!=” not working as expected
- How select query is generated in a Custom Post Type?
- Custom post type order by post_title
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- Linking posts together with Advanced Custom Fields “both ways”
- If custom taxonomy exist on post?
- Show first posts with custom field not empty and order all by title
- Help ordering custom query by Title, Ascending
- How to add parameters for custom post type
- CPT and metabox: create multi checkbox by using array?
- Is it possible to add query parameters on the archive page?
- Pulling in Related Posts based on Post Type array
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Query child posts on parents single.php?
- Query Posts From Multiple Post Types
- Custom Post Type Author Array Problem
- Pagination not working with custom loop
- WordPress can only query up to 766
- Pagination not working with custom loop
- Pagination not working with custom loop
- Show custom posts with a specific “custom TAXONOMY slug” on startpage
- Allow admin to determine the order of queries?
- Posts 2 Posts: query connected — orderby problem
- Code in custom widget queries all posts, when it should only query the current post
- How to add post type in masonry posts elementory widget
- Get Posts ordered by a date custom meta field
- How can I show a field ID in Elementor with Request Parameter
- post__in select all custom posts and not the selected array of ids