Cách sắp xếp hiển thị thứ tự bài mới nhất trong WooCommerce 3

5/5 - (1 bình chọn)

Khi chúng ta nâng cấp lên WooCommerce 3, sẽ gặp rất nhiều vấn đề xảy ra, 1 trong số đó là ở trang danh mục sản phẩm các sản phẩm sẽ hiển thị không đúng thứ tự mà ta mong muốn, Ở bài này, Zubi Cloud chia sẻ cho bạn cách để sắp xếp lại trang danh mục sản phẩm, chúng sẽ được hiển thị theo thứ tự: sản phẩm nào mới đăng thì sẽ hiển thị lên đầu, theo tuần tự 

  • Cách sắp xếp hiển thị thứ tự bài mới nhất trong WooCommerce 3, bạn chỉ cần chèn đoạn code sau vào file functions.php
add_filter('woocommerce_get_catalog_ordering_args', 'am_woocommerce_catalog_orderby');
function am_woocommerce_catalog_orderby( $args ) {
$args['order'] = 'desc'; 
return $args;
}
5/5 - (1 bình chọn)


  1. I blog often and I truly thank you for your information. This article has really peaked my interest.
    I’m going to book mark your website and keep checking for new information about
    once a week. I opted in for your RSS feed as well.

  2. whoah this weblog is great i love studying your posts.
    Stay up the good work! You already know, many individuals
    are searching round for this info, you can help them greatly.

  3. Wonderful website. Plenty of helpful info here. I am sending
    it to a few friends ans additionally sharing in delicious.
    And of course, thanks on your sweat!

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *