Support » Theme: Storefront » Home page – product categories filter by ids

  • Resolved dmcsupport

    (@dmcsupport)


    I have added the code below in functions.php – store front child theme – inc/functions.php file. But It’s not working? Can anyone tell me what am I doing wrong? Thank you.

    add_filter( ‘storefront_product_categories_shortcode_args’, ‘dq_product_categories_homepage’,999);
    function dq_product_categories_homepage( $args ) {
    $args[‘ids’] = array(30,45,46,47,48);
    $args[‘number’] = 5;
    return $args;
    }

    • This topic was modified 4 years ago by dmcsupport.
Viewing 1 replies (of 1 total)
  • Thread Starter dmcsupport

    (@dmcsupport)

    Ok I tried with the below code and it worked. For reference –
    $args[‘ids’] = ‘30,45,46,47,48’;

Viewing 1 replies (of 1 total)
  • The topic ‘Home page – product categories filter by ids’ is closed to new replies.