Listing connected pages as they are ordered at admin box
-
Hi,
I am sorry, but I could not find a simple answer on how to display the connected pages with the same ordering as it is set on the admin box drag’n’drop interface.
in my functions.php there is:
function my_connection_types() { p2p_register_connection_type( array( 'name' => 'related_pages', 'from' => 'page', 'to' => 'page', 'sortable' => 'any', ) );
and I have tried to do something like:
// Find connected posts $connected = new WP_Query( array( 'connected_type' => array ( 'related_posts', 'related_pages' ), 'connected_orderby' => 'position', 'connected_order' => 'asc', 'connected_order_num' => true, 'post_type' => array ( 'post', 'page' ), 'connected_direction' => 'from', 'connected_items' => get_queried_object(), 'nopaging' => true, ) );
Unfortunately this page https://github.com/scribu/wp-posts-to-posts/wiki/Query-vars tells me only how to sort by a meta field, and this did not help me really either: https://github.com/scribu/wp-posts-to-posts/wiki/Connection-ordering
Thank you!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Listing connected pages as they are ordered at admin box’ is closed to new replies.