I’m having the same issue, but working with SK Testimonials. It reorders everything. There should be an exclude post type option.
Thread Starter
domnar
(@domnar)
I think you can exclude post types in the extended version of the plugin. But since the extended version would be a bit of overkill for my purpose, I’m just trying to find a way to exclude the gallery. 🙂
Programmatically? I was about to look into it.
If you need to exclude, the Autosort option should be turned OFF, then include ‘orderby’ => ‘menu_order’ within the queries where you require the custom order to be set.
I confirm the advanced version contain such feature, where you can exclude certain post types from within the admin while using the Autosort ON.
Thread Starter
domnar
(@domnar)
Oh another little follow-up question: If I upgrade to the pro version, do I need to set the orders again, or does the plugin simly take over the setting from the basic version?
The Advanced Post Types Order plugin use a different code/technique which allow to order the post types for archive sections (all objects of a post type), within each categories (any taxonomies terms). For that reason the old defined order is useless. However we are working to find methods to make this possible.
A quick fix is to open post-types-order.php ange change the CTPOrderPosts function on line 85:
if ($options['adminsort'] == "1")
to
if ($options['adminsort'] == "1" && $query->query_vars['post_type'] !== 'attachment')
Full function after change:
function CPTOrderPosts($orderBy, $query)
{
global $wpdb;
$options = get_option('cpto_options');
//ignore the bbpress
if (isset($query->query_vars['post_type']) && ((is_array($query->query_vars['post_type']) && in_array("reply", $query->query_vars['post_type'])) || ($query->query_vars['post_type'] == "reply")))
return $orderBy;
if (isset($query->query_vars['post_type']) && ((is_array($query->query_vars['post_type']) && in_array("topic", $query->query_vars['post_type'])) || ($query->query_vars['post_type'] == "topic")))
return $orderBy;
error_log(($query->query_vars['post_type']), 0);
if (is_admin())
{
if ($options['adminsort'] == "1" && $query->query_vars['post_type'] !== 'attachment')
$orderBy = "{$wpdb->posts}.menu_order, {$wpdb->posts}.post_date DESC";
}
else
{
if ($options['autosort'] == "1")
$orderBy = "{$wpdb->posts}.menu_order, " . $orderBy;
}
//);
return($orderBy);
}
Thanks for the solution, klas_e! That was driving me a little nuts.
I have the plugin through my theme: Avada 3.0.1 (by themeforest). How can I resolve this issue?