1

I have a custom-post-type called 'artists'. I list them by the order attribute (menu_order).

$args = array(
    'post_status' => 'publish',
    'post_type'   => array('artists),
    'orderby'=> array('menu_order'=>'ASC' ),
);
$wp_query = new WP_Query( $args );

When I use the_post_navigation() to get the previous and next links, it takes the date as the order instead of the menu_order. How can I get it to work right in this case?

0

Maybe this function is better to use get_adjacent_post.

I have not tested it yet but it seems to more flexible than the_post_navigation() function.

FYI, the_post_navigation() uses this function internally to retrieve the next and previous posts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.