Djordje - George - Giorgio
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-

Issue solved and marked resolved.
Correct code snippet – inside functions.php file is:
add_action('wp_head', 'wt_cli_add_href_to_links', 1);
function wt_cli_add_href_to_links() {
if (!class_exists('Cookie_Law_Info')) return;
$script = '<script>
window.addEventListener( "DOMContentLoaded", addHrefToLinks );
function addHrefToLinks() {
var wt_cli_links = document.querySelectorAll( "#cookie-law-info-bar a, #cliSettingsPopup a" );
wt_cli_links.forEach( el => {
if(!el.hasAttribute("href"))
el.href = "#";
});
}';
$script .= '</script>';
echo $script;
}- This reply was modified 1 year, 11 months ago by Djordje - George - Giorgio.

Link does not have title attribute – prodeuces error on google insights for SEO
Do not sell my personal information – BUTTON
<a style=”color:#333333″ class=”wt-cli-ccpa-opt-out”>
Viewing 4 replies - 1 through 4 (of 4 total)