I have this script that automatically scrolls down to the primary content on page load.
jQuery(document).ready(function($){
if ( $(window).width() < 768 || window.Touch) {
$('html, body').animate({ scrollTop: $("#primary").offset().top}, 2000);}
});
1. However I would like to only apply it to our woocommerce product pages and categories so it doesnt work on home/blog pages. How would i do that?
I can do this poorly by editing WooCommerce core files but i know that's a horrible idea so I'm seeking out help on how to do it correctly via my functions.php file.
2. Also i would like to know how to apply it to all pages except the home page should that be a better option later on.
Many thanks!