Hello so i’m using the https://www.osano.com/cookieconsent/download/ open source cookie notifier !
So far I’ve meddled with my child theme’s functions.php and inserted this :
/**
Cookie consent code on head
*/
add_action('wp_head','cookie_consent');
function cookie_consent () { ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
<script>
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000000",
"text": "#ffffff"
},
"button": {
"background": "#0d66d0",
"text": "#ffffff"
}
},
"theme": "classic",
"position": "bottom-left",
"content": {
"message": "Acest site folosește cookie-uri pentru a-ți putea oferi o experiență superioară. ",
"dismiss": "OK",
"link": "Despre cookie!",
"href": "dopmotorsport.ro/cookie/"
}
});
</script>
<?php }
But it doesn’t work, i’ve tried modifying the header.php in my chil themes fodler by inserting the line :
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
and i get a big time error.
So where the heck do i insert these codes ? Is my function even ok ? Or do i need to do a :
function my_new_action() {
// Things the new action does.
}
add_action( 'x_before_site_begin', 'my_new_action', 10 ); ??
I’m so confused right now …