For fast loading in mobile view i want to remove woocommerce related products, what is the code to be added in function.php?
and I do not want to use CSS, thankyou.
Question posted in Woocommerce
The official Woocommerce documentation can be found here.
The official Woocommerce documentation can be found here.
2
Answers
You can use wordpress inbuilt function –
wp_is_mobile()
https://developer.wordpress.org/reference/functions/wp_is_mobile/
your complete code will be-
The function
woocommerce_output_related_products
is pluggable. So you can just re-write it.See: WooCommerce Code Reference
Include this in your functions.php