@twcfan92, thank you very much for this… The code does as desired…
And also @t-p, some inquiry…?
A strange thing… When I put this code in through Dashboard>Appearance>Editor>functions.php, and hit Update, it runs for long time, then reverts back, with this Redlined notice:
Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.
This happens so far on on two different servers, two different hosting situations… Figure it is part of all the changes with 4.9…
I put it in through the cPanel and it does what it is meant to do, totally fine…
And so question…?
Is WordPress now limiting code that can be put in through Dashboard>Appearance>Editor>functions.php…?
I have collected lots of functions that I use on sites, like this one, from wonderful folks like @twcfan92 who code way beyond me and freely share their skills…
And the notice top of style.css that can’t be dismissed normally…? Is there intention to “orchestrate” folks into different workflow patterns…?
To not be able to put in functions via the site is not so good, adds a lot of extra work unnecessarily…
I am hoping that is not the case, that this a bug, so to speak…?