Ajax Product Filter - How to have closed dropdown filters on mobile

If you want to have product filter widgets closed by default only on mobile, you can add the following few lines of code in your theme functions.php file, which should be placed in /wp-content/themes/THEMENAME/functions.php
 
Please be careful with the opening and closing php tags inside that file.
 
 
add_filter( 'yith_wcan_dropdown_type', 'yith_wcan_dropdown_type' );
function yith_wcan_dropdown_type( $dropdown_style ){
return wp_is_mobile() ? 'close' : $dropdown_style;
}
 
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center

Powered by Zendesk