I want to display product title befort the product image in shop loop.
I found a code it does that perfectly:
add_action(‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_after_shop_loop_item_title_short_description’, 5);
function product_change_title_position(){
remove_action(‘woocommerce_shop_loop_item_title’,’woocommerce_template_loop_product_title’);
add_action(‘woocommerce_before_shop_loop_item_title’,’woocommerce_template_loop_product_title’, 5);
}
add_action(‘init’,’product_change_title_position’);
But I only want to make this happen on mobile. Is that possible?
Site URL: hidden Theme version: 8.0.7 WooCommerce version: 5.8.0Hello,
You may try wp_is_mobile function
https://wpdynamic.com/wordpress-developer/wordpress-code-snippets/how-to-display-content-for-mobile-or-desktop-only-using-wordpress-wp_is_mobile/
Regards
You must be logged in to reply to this topic.Log in/Sign up
One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.