lundi 23 mai 2016

Remove an action based on screen size in WordPress / WooCommerce

I've added an action via hook like this

function my_wc_function(){

//function codes here;
}

add_action('woocommerce_before_shop_loop_item_title','my_wc_function' );

Now in my theme options, users have the option to remove this function, so I got this done:

if (get_option('wc_remove_function') == 1) {
 remove_action('woocommerce_before_shop_loop_item_title','my_wc_function' );
}

Everything goes well but my concern this, I have another option in my Theme Options where they should be able to remove the same function only on mobile screens (say less than 1024px).

How I can achieve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire