Support » Theme: Storefront » “Shop by Category” is showing by alphabetical order

  • masurana


    “Shop by Category” is showing by alphabetical order. However I want it showing by serial number. Please guide me. Thanks.

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

Viewing 1 replies (of 1 total)
  • ryanr14


    Hi @masurana,

    It looks like you are talking about this section of your homepage? Shop by Category
    Link to image:

    Just out of curiosity and assumption, you’re using the Storefront Homepage page template and then have re-ordered that section lower down the page. If so, there are a few options to change this.

    One option is to rebuild this using the block editor. Instead of the homepage page template you’d change the page template to full-width and insert blocks to your liking. For the product category area I would use the shortcode block and then enter the product category IDs in the order you want them. Something like this image below does.

    Link to image:

    If you want to keep using the current homepage template, we’ll need to dig into some PHP. The way the categories are ordered is filterable, so you can use a snippet like the one below to change the orderby argument to use ID instead of the name. I’d use a plugin like Code Snippets to add this to your site.

    add_filter( 'storefront_product_categories_args', function( $args ){
        $args['orderby'] = 'id';
        return $args;
    • This reply was modified 1 year ago by ryanr14.
Viewing 1 replies (of 1 total)
  • The topic ‘“Shop by Category” is showing by alphabetical order’ is closed to new replies.