Forum Replies Created

Viewing 1 replies (of 1 total)
  • OuchMyAppendix

    (@ouchmyappendix)

    @gavin27 : Here is the whole function to copy/paste. Original line is commented out and the modification is present.

    function CPTOrderPosts($orderBy)
        {
            global $wpdb;
    
            $options = get_option('cpto_options');
    
            if (is_admin())
                    {
                        if ($options['adminsort'] == "1")
                            $orderBy = "{$wpdb->posts}.menu_order, {$wpdb->posts}.post_date DESC";
                    }
                else
                    {
                        if ($options['autosort'] == "1")
                        	// Here is where the edit goes
                        	$orderBy = "{$wpdb->posts}.menu_order, " . $orderBy;
                            //original code is commented out
                            //$orderBy = "{$wpdb->posts}.menu_order, {$wpdb->posts}.post_date DESC";
                    }
    
            return($orderBy);
        }

    @op – Thanks so much for this, I was having an issue with this plugin changing the order of attachments on my page and this fixed it. Kudos!

Viewing 1 replies (of 1 total)