Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 130709

Order by categories or most recents (DESC)

$
0
0

Replies: 0

Hi there,

I am trying to organize my homepage of products into my ecommerce (using woocommerce, of course) but it is not working.

Before updating my wordpress and theme to 4.7.1, I was using the following code to order by my products by descending date:

add_filter('woocommerce_get_catalog_ordering_args', 'am_woocommerce_catalog_orderby');
function am_woocommerce_catalog_orderby( $args ) {
    $args['orderby'] = 'date';
    $args['order'] = 'desc';
    return $args;
}

It used to work before I updated my wordpress, but now it is not working. So, I have two questions and I really appreciate if you guys can help me.

1) Am I doing something wrong to display my procuts by date (descending order)?

2) Is there anyway to show the products by category? Example: I want to show the category ~Shirts~ after the category ~Sunglasses~, can I do that tweaking the code above?

Thanks so much and sorry about my english, I am not a native speaker.

Kind Regards.


Viewing all articles
Browse latest Browse all 130709

Trending Articles