This topic has 3 replies, 3 voices, and was last updated 10 months, 1 weeks ago ago by Andrew Mitchell
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?
Hello,
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
Dear ziga32,
We trust our theme is enhancing your experience. Taking a brief moment to rate it with a glowing 5 stars on ThemeForest would be immensely appreciated. Your feedback holds significant value for us.
Click here to rate now: https://themeforest.net/downloads
Thank you sincerely for your ongoing support!
Best Regards,
The 8Theme Team
Tagged: best selling, display, functions, mobile, scripts, themes, woocommerce
The issue related to '‘how to display functions Script on mobile only’' has been successfully resolved, and the topic is now closed for further responses