Custom name
Posted by:
Ricardomb75
Nov 22, 2020 at 14:03 (3 year ago)
Hello,
I changed armania's theme name by my custom name but every time the home page is rendering armania tilte shows up a few seconds before my custom name appears. Especialy on mobile device
This is what I did in my functions.php file and my js folder: /www/wp-content/themes/armania-child/js:
document.addEventListener('DOMContentLoaded', function () {
//Change the title site in the header if no logo
let html = document.querySelector('.text').innerHTML;
let html_1 = document.querySelector('.highlight').innerHTML;
let newText = html.replace(/Arma/g, 'Deuces');
let newText_2 = html_1.replace(/nia/g, '-rose');
document.querySelector('.text').innerHTML = newText;
document.querySelector('.highlight').innerHTML = newText_2;
//Change the placeholder text in the input search field
document.getElementsByName('s')[0].placeholder = 'Vous cherchez un article ?';
});
What is the best way to achieve that ?. Thank you in advance.
I changed armania's theme name by my custom name but every time the home page is rendering armania tilte shows up a few seconds before my custom name appears. Especialy on mobile device
This is what I did in my functions.php file and my js folder: /www/wp-content/themes/armania-child/js:
document.addEventListener('DOMContentLoaded', function () {
//Change the title site in the header if no logo
let html = document.querySelector('.text').innerHTML;
let html_1 = document.querySelector('.highlight').innerHTML;
let newText = html.replace(/Arma/g, 'Deuces');
let newText_2 = html_1.replace(/nia/g, '-rose');
document.querySelector('.text').innerHTML = newText;
document.querySelector('.highlight').innerHTML = newText_2;
//Change the placeholder text in the input search field
document.getElementsByName('s')[0].placeholder = 'Vous cherchez un article ?';
});
What is the best way to achieve that ?. Thank you in advance.