• Resolved tdlui

    (@tdluiamisola)


    Hi Support,

    Good day, we have a problem with the plugin when we go to the settings and set hide on the posts and save. on the website, the reorder is still interfering with the default order even if it is set to hide, I can’t uncheck the auto sort, because we need it on the other custom post, and also I have not set the menu_order on the custom query because I’m relying on the auto-sort setting.

    When I disable the plugin the sorting of my post became normal. that is why I am 100% sure that the plugin is the one manipulating the custom order.

    Please advise what to do.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Maya

    (@tdgu)

    Hi,
    You have 2 options here:

    1) Turn OFF the Autosort and include ‘orderby’ => ‘menu_order’ within queries where sort is required to apply

    2) If need Autosort ON, rely on filter pto/posts_orderby/ignore to ignore the sort apply for specific queries, e.g. check if the query include a given post type for which you don’t want to re-order see this topic for example https://wordpress.org/support/topic/sorting-problem-with-the-web-2-0-directory-plugin/

    3) If need to keep Autosort ON, you can try to reset all menu_order column to default (zero) within wp_posts table, for the post type you need to order by date. This is a high risk operation, i recommend to create a database back-up just in case something go wrong.

    Thanks

    Thread Starter tdlui

    (@tdluiamisola)

    Thank you for the quick response, I will try the option 2, I definitely don’t want to do the option 3.

    Maybe it is a good idea if ever the user changes the show/hide settings that post/custom post will be ignored. just a suggestion.

    I will reply back if its resolve, thank you.

    Thread Starter tdlui

    (@tdluiamisola)

    Hi Support,

    I tried the option 2, it works but my other custom post that needed a custom order is also affected. I like the post_type = post to disregard the custom order kindly help, below is the code I used.

    
    add_filter( 'pto/posts_orderby/ignore', pto_posts_orderby_ignore, 10, 3);
        function pto_posts_orderby_ignore($ignore,  $orderBy, $query) {
    		if (isset($query->query_vars['post_type']) == "post")
    			$ignore = TRUE;
    		return $ignore;  
    	}
    
    Thread Starter tdlui

    (@tdluiamisola)

    Hi Support,

    It seems that it is working correctly when I removed the isset

    here is the final code that works:

    
    	add_filter( 'pto/posts_orderby/ignore', pto_posts_orderby_ignore, 10, 3);
        function pto_posts_orderby_ignore($ignore,  $orderBy, $query) {
    		if ($query->query_vars['post_type'] == "post")
    			$ignore = TRUE;
    		return $ignore;  
    	}
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hiding reorder interface on a post not working properly’ is closed to new replies.