• I need the filter button to activate the off canvas, to be active also for the desktop version. Is it possible to do so? Thank you

Viewing 1 replies (of 1 total)
  • Hello there,

    I hope you’re doing well 😀

    If you want to show the mobile filters also for desktop, try to add the following code in the functions.php of your active theme

    if( ! function_exists( 'yith_wcan_get_mobile_media_query' ) ){ 
    function yith_wcan_get_mobile_media_query(){ 
    return 99999; 
    } 
    } 
    
    if ( ! function_exists( 'yith_wcapf_change_script_args' ) ) { 
    function yith_wcapf_change_script_args( $args ) { 
    $args['mobile_media_query'] = yith_wcan_get_mobile_media_query(); 
    return $args; 
    } 
    add_filter( 'yith_wcan_shortcodes_script_args', 'yith_wcapf_change_script_args', 10, 1 ); 
    } 
    
    if( ! function_exists( 'yith_wcan_change_media_query_style' ) ){ 
    function yith_wcan_change_media_query_style(){ 
    $mobile_media_query = yith_wcan_get_mobile_media_query(); 
    $handle             = 'yith-wcan-shortcodes'; 
    $css                = '@media( max-width: 991px ) { 
    body.filters-in-modal .yith-wcan-filters { 
    display: block; 
    } 
    } 
    @media( max-width: ' . $mobile_media_query . 'px ) { 
    body.filters-in-modal .yith-wcan-filters { 
    display: none; 
    } 
    }'; 
    wp_add_inline_style( $handle, $css ); 
    } 
    
    add_filter( 'wp_enqueue_scripts', 'yith_wcan_change_media_query_style', 99 ); 
    }

    Please, try it and let me know.

    Have a good day.

Viewing 1 replies (of 1 total)

The topic ‘Activate filter button.’ is closed to new replies.