I am looking for function for WooCommerce which change meta title text in non-active tab. Anybody know how can I do it? I find this JS code but it does not work in themes function.php file:
$(function() {
var message = "Don't forget us";
var original;
$(window).focus(function() {
if (original) {
document.title = original;
}
}).blur(function() {
var title = $('title').text();
if (title != message) {
original = title;
}
document.title = message;
});
});
2
Answers
You can put that script into a tag
<script></script>
in the footer.php file wich should be located in your theme (don’t forget to actually duplicate this file inside your child theme)EDIT: Also make sur to have JQuery in your frontend
The following goes into
functions.php