• My products currently sort themselves in alphabetical order on my website. I’d like to have them sorted from newest to oldest. How do I change the order so they sort that way on my website?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author andrewmrobbins

    (@andrewmrobbins)

    @mrdaryl21

    Hey there,

    Are you using a shortcode? If so, you can add the “sort_by” attribute like this:

    [wps_products sort_by="created_at"]

    Otherwise, to change the order of the default product listing page you can add this snippet of PHP to your WordPress theme’s functions.php file:

    // Sort products by newest first
    add_filter('shopwp_products_all_args', function($settings) {
    
       $settings['sort_by'] = 'created_at';
    
       return $settings;
    
    });

    Let me know if this helps!

    Thread Starter mrdaryl21

    (@mrdaryl21)

    Hey there!

    Sorry to sound stupid, as I am just the website owner not the author. So I’m trying to learn and do stuff on my own. This is the code that is already in short code?

    [wps_products excludes=”description” title_size=”24px” align_height=”true”]

    How would I add the short code you provided?

    Thank you so much!

    Plugin Author andrewmrobbins

    (@andrewmrobbins)

    @mrdaryl21 No problem, happy to help.

    Try using this shortcode instead:

    [wps_products excludes="description" title_size="24px" align_height="true" sort_by="created_at"]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I sort my products on my page’ is closed to new replies.