Title: [Plugin: Post Types Order] Previous / Next Navigation &#8211; Wrong order
Last modified: August 20, 2016

---

# [Plugin: Post Types Order] Previous / Next Navigation – Wrong order

 *  Resolved [sebchauss](https://wordpress.org/support/users/sebchauss/)
 * (@sebchauss)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-post-types-order-previous-next-navigation-wrong-order/)
 * **Versions :**
    WP 3.3.2 Advanced Post Types Order 2.5.0.3.1
 * **Problem :**
    The posts I get from the get_adjacent_post() function in single.
   php don’t respect the order defined with your plugin if “Auto Sort” is defined
   on “ON/Custom”. But it’s ok with “Auto Sort” defined on “ON”.
 * [http://wordpress.org/extend/plugins/post-types-order/](http://wordpress.org/extend/plugins/post-types-order/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [sebchauss](https://wordpress.org/support/users/sebchauss/)
 * (@sebchauss)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-post-types-order-previous-next-navigation-wrong-order/#post-2852491)
 * Sorry, I gave the wrong versions. Here are the right ones :
 * **Versions :**
    WP 3.3.2 Advanced Post Types Order 2.5.0.5
 *  Plugin Author [nsp-code](https://wordpress.org/support/users/nsp-code/)
 * (@nsp-code)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-post-types-order-previous-next-navigation-wrong-order/#post-2852502)
 * This is an expected behavior under the ON/Custom AutoSort Option. Only when AutoSort
   is turned ON the next/previous links are updated.
 * In this case you will need to use the **previous_post_type_link** and **next_post_type_link**
   functions which should replace the default **previous_post_link** and **next_post_link**
 * **Usage example:**
    previous_post_type_link( ‘%link’, __( ‘<span class=”meta-
   nav”>←</span> Previous’, ‘twentyeleven’ ), FALSE, ’14’, ‘category’ );
 * where the arguments are 
    $format, $link, $ignore_custom_order, $term_id, $taxonomy_name
 *  Thread Starter [sebchauss](https://wordpress.org/support/users/sebchauss/)
 * (@sebchauss)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-post-types-order-previous-next-navigation-wrong-order/#post-2852507)
 * Ok but what I need are the posts :
 *     ```
       $nextPost = get_adjacent_post(false,'',false);
       $prevPost = get_adjacent_post(false,'',true);
       ```
   
 * And it doesn’t work with it.
 *  Plugin Author [nsp-code](https://wordpress.org/support/users/nsp-code/)
 * (@nsp-code)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-post-types-order-previous-next-navigation-wrong-order/#post-2852689)
 * To retrieve the post data you can use the following:
 * > apto_get_adjacent_post ($ignore_custom_sort, $term_id = ”, $taxonomy = ”, $
   > previous)
 * The $previous require a Boolean variable, TRUE if you need previous post or FALSE
   for next.
 * The function is relative to the default query $post variable content, so if you
   need to use it along with a custom query, make sure you use a new WP_Query call.
   [http://codex.wordpress.org/Class_Reference/WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query)
 *  Thread Starter [sebchauss](https://wordpress.org/support/users/sebchauss/)
 * (@sebchauss)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-post-types-order-previous-next-navigation-wrong-order/#post-2852704)
 * That seems ok even if the order is weird if you haven’t clicked yet on the “update”
   button in the “re-order” screen.
 * Thank you.
 *  Plugin Author [Maya](https://wordpress.org/support/users/tdgu/)
 * (@tdgu)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-post-types-order-previous-next-navigation-wrong-order/#post-2852705)
 * This may return different results that the default get_adjacent_post since the
   apto_get_adjacent_post **can** return next/previous for a term objects list instead.
   So this is an expected result, unless you need to use the archive as reference
   in which case you may want to use the default get_adjacent_post or use empty 
   params for the apto_get_adjacent_post

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Post Types Order] Previous / Next Navigation – Wrong order’ 
is closed to new replies.

 * ![](https://ps.w.org/post-types-order/assets/icon-128x128.png?rev=1226428)
 * [Post Types Order](https://wordpress.org/plugins/post-types-order/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-types-order/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-types-order/)
 * [Active Topics](https://wordpress.org/support/plugin/post-types-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-types-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-types-order/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [Maya](https://wordpress.org/support/users/tdgu/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-post-types-order-previous-next-navigation-wrong-order/#post-2852705)
 * Status: resolved