I have this WORKING SCRIPT:
<script>
jQuery( document ).ready(function() {
console.log( "ready!" );
var hideUrl=[
'https://www.gustotosto.it/shop/boni/',
'https://www.gustotosto.it/shop/agropic/',
];
if(hideUrl.indexOf(window.location.href)>=0){
jQuery('.title-shop').hide();
}
});
</script>
Now I want to modify it, because it just hides the ".title-shop" for the urls listed in the var; I want to extend it and hide ".title-shop" if url contains the var hideUrl, subpages included. I modified it like this but it isn ot working. What is wrong? someone can help me?
<script>
jQuery( document ).ready(function() {
console.log( "ready!" );
var hideUrl=[
'https://www.gustotosto.it/shop/boni/',
'https://www.gustotosto.it/shop/agropic/',
];
if (window.location.href.indexOf("hideUrl") > -1){
jQuery('.title-shop').hide();
}
});
</script>