Classic table isn’t correctly sorting

[ad_1]

In a website I use an old commercial theme (not updated anymore).

The theme features a custom post type for Events. So, by clicking the left menu I get to the main Events page, where I find the list of any event (the traditional WP table list).

The problem: since I’m NOT the administrator of the website, I never noticed the table doesn’t sort correctly the posts. To have it working I have to click two times the Date label in the header. I don’t know if this has always been its behavior because I never received any complaint.

I searched anywhere through the files of the theme but I could not find what is causing this issue (moreover, some years ago I made a plugin for this website and the plugin features an identical table that shows no issue).

Apparently, the only thing related to Events is the following (I found it in a theme-init file):

function events_post_register()

{$labels = array(
'name' => __('Events', 'taxonomy general name', CORE_THEME_NAME),
'singular_name' => __('Event', CORE_THEME_NAME),
'search_items' => __('Search Events', CORE_THEME_NAME),
'all_items' => __('All Events', CORE_THEME_NAME),
'parent_item' => __('Parent Event', CORE_THEME_NAME),
'edit_item' => __('Edit Event', CORE_THEME_NAME),
'update_item' => __('Update Event', CORE_THEME_NAME),
'add_new_item' => __('Add New Event', CORE_THEME_NAME),
'menu_name' => __('Events', CORE_THEME_NAME)
);

$args = array(
'labels' => $labels,
'singular_label' => __('Events', CORE_THEME_NAME),
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'hierarchical' => true,
'exclude_from_search' => true,
'capability_type' => 'post',
'query_var' => 'event',
'rewrite' => array(
'slug' => 'event',
'with_front' => false,
),
'menu_icon' => 'dashicons-calendar',
'supports' => array(
'title',
'editor',
'thumbnail',
'excerpt',
'comments',
'custom-fields'
)
);

register_post_type( 'event', $args );

}

Any help is appreciated. 🙂

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer