So, now I’ve decided to sort in php:
function compare_collections( $c1, $c2 ) {
if( $c1->menu_order == $c2->menu_order ) {
return ( $c1->post_title < $c2->post_title ) ? -1 : 1;
} else {
return ( $c1->menu_order < $c2->menu_order ) ? -1 : 1;
}
}
// and then in my template:
uasort( $colls->posts, 'compare_collections' ) ;
But I would be glad to understand what’s wrong 🙂
My guess is that p2p_type( )->get_connected
‘s sorting preferences are stronger or like that. Excuse me, I am not a programmer 🙂
Related Posts:
- Custom Post Type order by modified date and custom meta field issue
- Changing WordPress sort order for returned child pages
- Custom post type order by post_title
- Show first posts with custom field not empty and order all by title
- Help ordering custom query by Title, Ascending
- Allow admin to determine the order of queries?
- Order custom post type is beign ignored
- Pagination not working with custom loop
- Adding ‘menu order’ column to custom post type admin screen
- Get the ID of the latest post
- Displaying a custom post type alphabetically
- Sort custom post type list table by display name of a user id stored as post meta value
- Creating relationships between multiple content types [closed]
- Ordering posts having multiple post-meta date fields
- How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
- Order Posts by Taxonomy and Meta Value
- Custom Post type sort order not working in the admin area
- ascending order custom post type
- query order by date on custom type: wrong order
- Taxonomy list. Order by a specific custom post type count
- Query posts between two dates (custom meta keys) CMB2
- Adding posts of custom type into the main feed
- Custom Select Query with Custom Post Types
- Connecting a taxonomy with a post type
- WP_Query search posts by custom post type and custom taxonomy
- Calculating Bayesian average for custom post type
- 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
- Query string parameters from custom fields, inconsistent results
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- 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]
- Combining sorted and random CPT
- 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
- 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
- How to set order for a custom post type
- Making certain categories of CPT not publicly queryable
- Get parse_query filter to return slug instead of id
- Querying both pages and posts
- How to order and group custom post type posts by year and month
- First custom field value (out of several) displayed twice after query
- Prioritize posts in query by meta keys?
- Displaying Posts from Custom Post Types
- Different Ways to Query Custom Post Types?
- Post 2 Post: Getting connected ‘person’ from post author
- How to organise this data within WordPress
- Manage Columns : order by post_parent’s title
- Archive not sorting correctly
- Add a custom meta box for client to order CPT posts how they want
- Number of posts in the archive
- How to query 2 custom post types that need to share a slug?
- Custom post type sorting: alphabetical order
- 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
- How to conditionally add Custom Post Type to Front Page
- 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
- Getting custom post types to properly display alphabetically
- Post ordering not working with custom field
- Custom types, taxonomies and query optimization
- Adding Page Ordering to a Custom Page Type
- Query custom posts from custom taxonomy
- All in one calendar custom post type query doesnt work as expected
- Displaying Portfolio Filter by Category Order (alphabetically)
- Adding a Custom Field to be used by Posts 2 Posts
- Order posts by taxonomy terms
- Query filter by value in meta_value array
- wp rest api orderby field in a custom table
- Using OR relation in meta_query to check for a value before sorting by another
- Does this archive template part look like its making too many calls to the db?
- How to order taxonomy terms by most recent post?
- Display custom posts, ordered by most commented, without duplicates
- order custom post type posts by custom date
- How to hide sub fields in a field group and also the entire field group if the answer selected is “no”
- Wp Query sort order from custom MetaBox
- post type => ‘any’ not applied my custom queries
- Using Orderby and meta_value to order natural/alphanumerical
- How do I display specific custom posts, and how do I edit a post’s singular page?
- What’s the most efficient way to get two queries based on an if statement?
- Custom post order when using OR relation
- show previous/next post orderer by title in custom post types
- Query child posts on parents single.php?
- WordPress can only query up to 766
- How would I get a list of posts from a custom post type
- WordPress search results
- 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
- Load posts via AJAX without draft status