Update: the woocommerce sorting was also lost from the site, so I contacted also the Neve theme support.
]]>I’m facing an issue with the plugin. When all posts are loaded, they are sorted alphabetically instead of by the newest. However, when I click on a category, the posts are sorted correctly.
]]>Although when I use woocommerce in the admin area it is very easy to order the products in the way I want it is a different story on the actual site. The link above is to one of six product categories and I want the products to appear so the latest ones come at the top. Unfortunately nothing I seem to do works and all the latest items are always on the last page and never on page 1. I do not want to have to tell everyone who is looking to re-order to something else then order by latest which it should do by default but doesn’t. I have tried all kinds of plugins but none of them do what I want it to do.
Please will someone tell or show me how to sort it out. The people who built the site say it is a conflict between WordPress and Woocommerce.
Kindest regards, Mark
]]>Now i’m no coder but i asked ChatGPT and it tweaked the plugin and it works.
<?php
/**
* Admin Slug Column (Streamlined Version)
*
* @package Admin_Slug_Column_Simplified
* @wordpress-plugin
* Plugin Name: Admin Slug Column (Streamlined)
* Description: Adds a sortable "Slug" column to the admin posts/pages list without additional columns.
* Version: 1.0
* Author: Adapted Plugin
*/
// If this file is called directly, abort
if ( ! defined( 'WPINC' ) ) {
die;
}
// Only run plugin in the admin
if ( ! is_admin() ) {
return;
}
// Add slug column to admin posts/pages lists
function add_slug_column($columns) {
$columns['slug'] = __('Slug');
return $columns;
}
add_filter('manage_posts_columns', 'add_slug_column');
add_filter('manage_pages_columns', 'add_slug_column');
// Populate slug column with the post slug
function display_slug_column_content($column, $post_id) {
if ($column === 'slug') {
$post = get_post($post_id);
echo esc_html($post->post_name); // Display the post slug
}
}
add_action('manage_posts_custom_column', 'display_slug_column_content', 10, 2);
add_action('manage_pages_custom_column', 'display_slug_column_content', 10, 2);
// Make slug column sortable
function add_slug_column_sortable($columns) {
$columns['slug'] = 'slug';
return $columns;
}
add_filter('manage_edit-post_sortable_columns', 'add_slug_column_sortable');
add_filter('manage_edit-page_sortable_columns', 'add_slug_column_sortable');
// Modify the query to sort by slug when requested
function sort_by_slug_column($query) {
if (!is_admin() || !$query->is_main_query()) {
return;
}
$orderby = $query->get('orderby');
if ('slug' == $orderby) {
$query->set('orderby', 'name'); // 'name' represents the slug in the database
}
}
add_action('pre_get_posts', 'sort_by_slug_column');
]]>I have an issue with the plugin. When all posts are loaded, the plugin sorts them alphabetically instead of by the newest. However, when I click on a category, it sorts them correctly.
]]>i preset sorting on newest products but in result available products are mixed with unavailables
and now when i change sorting once it works fine and sort all availables first (for example in this picture i choose 2nd sorting and again go back to first sorting which is newest)
2: im using sorting filter in a group of filters and i turned on “display selected parameters of filters” option for the group but i want to turn it off exclusively for sorting filter, can u please add an exlusion inside sorting filter option or is there a code to turn it off only for sorting filter?
3: stock status filter (in-stock toggle) correct me if i misunderstood of what i expect from this option
is to show only available products and hide the rest,
instead its showing all products (available & unavailable) and then sorting available products first
4: for price sale filter (in this case filter skin is set to big skin) i need to swap the position of lower counters (for rtl) and the numbers should start from middle or left
I’m working on a WooCommerce website using the Flatsome theme and Elementor. However, the default WooCommerce sorting is not appearing on the product catalog page. I’ve already checked if it’s hidden behind the header and reviewed the settings under Customize → WooCommerce → Product Catalog. The sorting option is currently set to “Default ordering (custom ordering + name).”
Could you please help me with restoring the default WooCommerce sorting functionality, or suggest an alternative plugin that can provide similar sorting options?
Thank you for your assistance.
]]>