• Resolved Matt Sartori

    (@msartori)


    This has been happening with all sites I’m using Simple Custom Post Order on for the last month or two. I can drag and drop all I want, but the order is never saved.

    This shows what happens when I drag items into a new order and refresh the page. https://share.getcloudapp.com/bLulGlLl

    I am using the Twenty Twenty-Three theme with only Simple Custom Post Order and Custom Post Type UI activated. It also happens with just normal post categories when I don’t have CPT UI activated.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @msartori,

    Thanks for reaching out!

    Can you please go to Settings > SCPOrder > and make sure to check Categories from that list and the custom post category for Books > save.

    This should solve it.

    Warmly,

    Mihaela

    Thread Starter Matt Sartori

    (@msartori)

    Hi Mihaela,

    Thanks for getting back to me. The Category sorting is enabled as are many other terms and post types, but none of them will save their position after dragging and dropping.

    I did click the Update button just to see if that worked but it did not.

    Thread Starter Matt Sartori

    (@msartori)

    Hi Mihaela,

    One more thing I’d like to mention is that the response from the server doesn’t seem to be what I’d expect. For instance when the request is sent, it’s sent with an array of IDs in the order I put them on the screen, however the returned value is 0. I would expect a 1 or TRUE if successful, not a zero.

    Thanks,
    Matt

    Thread Starter Matt Sartori

    (@msartori)

    Hi Mihaela,

    Can you please reopen this ticket/thread? It has not yet been resolved.

    Thanks,
    Matt

    Can you please let me know your WordPress version and PHP version?

    We are trying to reproduce the same behavior but without any luck.

    Thank you!

    Thread Starter Matt Sartori

    (@msartori)

    Hi Mihaela,

    WordPress 6.1.1
    PHP 8.0.28
    Percona 5.7.40

    I also tried Intuitive Custom Post Order with the same results when using the Twenty Twenty-Three theme and all plugins (except CPT UI) turned off.

    The term_order field is in the terms table. The order doesn’t seem to update in the table after moving terms around using the UI. I’m not able to sort anything from custom post types to posts to pages to taxonomies.

    I did find a set of plugins that are working for me which are Post Types Order and Category Order and Taxonomy Terms Order but I’d much rather be using Simple Custom Post Order.

    I’m not sure if this makes a difference but I’m hosted with WP Engine.

    Thank you, Matt!

    I tried again with those same plugins, the theme, WP version, and PHP version and unfortunately I could not replicate the same issue.

    The most I can do at the moment is open a ticket regarding this so our dev team can take a closer look and see if they can replicate and investigate this.

    You can follow the progress here: https://github.com/ColorlibHQ/simple-custom-post-order/issues/121

    I’m sorry for the trouble! Thank you for your patience.

    Warmly,

    Mihaela

    the support of ‘page-attributes’ is required to be first added to the post type generated manually, in order, to later call the ‘menu_order‘ directive. This directives allows the order to be done according to defined setting and not according to default post creation time.

    You may read more about it, here

    So the adding of the element to be controlled on functions.php would now look like this:

    function list_faq() {
        register_post_type('faq_questions',
            array(
                'labels' => array(
                    'name' => __('FAQ'),
                    'singular_name' => __('FAQ')
                ),
                'public' => true,
                'has_archive' => true,
                'supports' => array('title', 'editor', 'thumbnail', 'excerpt' , 'page-attributes')
            )
        );
    }
    
    add_action('init', 'list_faq');

    And the placing on the website of the fetched content would now look like this:

    <div class="tabcontent-box" id="id">
    	<ul class="ul-content">
    	<?php
    	$query = new WP_Query(array(
    		'post_type' => 'faq_questions',
    		'orderby' => 'menu_order',
    		'order' => 'ASC',
    		'tax_query' => array(
    			array(
    				'taxonomy' => $current_term->taxonomy,
    				'field' => 'slug',
    				'terms' =>	$current_term->slug
    
    			)
    		)
    	));
    	while ( $query->have_posts() ) : $query->the_post(); ?>
    		<li>
    			<a href="<?php the_permalink() ?>" class="tabcontent-link"><?php the_title() ?></a>
    		</li>
    	<?php endwhile; ?>
    	</ul>
    </div>

    And now… the magic returns, and moving by drag-and-drop of the elements with this plugin is back to working.

    You may also manually change the numbering of menu_order on the WordPress POST data base, according the post_type of the highlighted chosen by you name. This is required when you have more p

    Hi,

    I just face the same issue in a website and spent a little while debugging and found the issue to be with object caching. When I drag-and-drop to re-order, then reload the page, the posts go back into their original order. If, however, I purge the object cache after changing the order, the changed order persists in the post list screen.

    It may be that recent changes to WP_Query (see here) could be the cause – I haven’t dug that far into it but it seems likely to me as this plugin always worked without issue previously.

    Cheers,
    Phil

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not saving after sorting’ is closed to new replies.