{"id":6944,"date":"2018-06-12T17:03:38","date_gmt":"2018-06-13T00:03:38","guid":{"rendered":"http:\/\/www.dognmonkey.com\/techs\/?p=6944"},"modified":"2020-01-09T09:43:04","modified_gmt":"2020-01-09T17:43:04","slug":"how-to-implement-eu-cookies-warning","status":"publish","type":"post","link":"https:\/\/www.dognmonkey.com\/techs\/how-to-implement-eu-cookies-warning.html","title":{"rendered":"How To Implement EU Cookies Warning"},"content":{"rendered":"<p><em>Due to these EU cookies laws, all the website must display a cookie warning for reader to continue or leave.\u00a0 After so much time to search for the best solution since we display Ad-sense\u00a0and Amazon ads, we need to comply and finally we found a <a href=\"https:\/\/cookieconsent.insites.com\/download\/\" target=\"_blank\" rel=\"noopener noreferrer\"><button class=\"w3-button w3-blue w3-round-xlarge\">cookie consent website<\/button><\/a> that shows us how to do it. It&#8217;s quite simple.<\/em><\/p>\n<p><em>While we&#8217;re searching, we found a way to display the text box with a close button to turn it off.<\/em><\/p>\n<div class=\"igallery\">\n<p style=\"text-align: center;\"><a class=\"preview\" title=\"cookie warning float top-right\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_cookie_warning.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-6949\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/z_cookie_warning-200x112.jpg\" alt=\"cookie warning float right\" width=\"200\" height=\"112\" \/><\/a> <a class=\"preview\" title=\"text box with close button\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/textbox_close.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-thumbnail wp-image-6945\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/textbox_close-200x112.jpg\" alt=\"text box with close button\" width=\"200\" height=\"112\" \/><\/a><\/p>\n<\/div>\n<p><em>We need the scripts<\/em><\/p>\n<p><code>$jC(document).ready(function(c) {<br \/>\n$jC('.alert-close').on('click', function(c){<br \/>\n$jC(this).parent().fadeOut('slow', function(c){<br \/>\n});<br \/>\n});<br \/>\n});<\/code><\/p>\n<p><em>no-conflict and set in the footer.php<\/em><\/p>\n<p><code>&lt;script type=\"text\/javascript\"&gt;<br \/>\nvar $jC=jQuery.noConflict();<br \/>\n$jC(document).ready(function(){<br \/>\n});<br \/>\n&lt;\/script&gt;<br \/>\n&lt;script src=\"&lt;?php bloginfo('template_url'); ?&gt;\/ijs\/cookie.js\" type=\"text\/javascript\"&gt;&lt;\/script&gt;<\/code><\/p>\n<p><em>The textbox with close button<\/em><\/p>\n<p><code>&lt;div id=\"cookie\"&gt; &lt;p style=\"text-align=center\";&gt;&lt;em&gt; Dognmonkey uses &lt;a href=\"\/\/www.dognmonkey.com\/techs\/privacy-policy\" target=\"_blank\"&gt;cookies&lt;\/a&gt; to give you the best experience. Please continue if you're OK with this.&lt;div class=\"alert-close\"&gt;\u00d7&lt;\/div&gt;&lt;\/em&gt;&lt;\/p&gt;&lt;\/div&gt;<\/code><\/p>\n<p><em>CSS for the text box<\/em><\/p>\n<p><code><em>#cookie {position:fixed;font-size:.6em; background:url(..\/images\/info_icon.png) 10px 11px #0079a9;background:url(..\/images\/info_icon.png) 10px 11px,-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,#009ddc),color-stop(100%,#0079a9));background:url(..\/images\/info_icon.png) 10px 11px,-moz-linear-gradient(top,#009ddc,#0079a9);background:url(..\/images\/info_icon.png) 10px 11px,-ms-linear-gradient(top,#009ddc,#0079a9);background:url(..\/images\/info_icon.png) 10px 11px,-o-linear-gradient(top,#009ddc,#0079a9);background:url(..\/images\/info_icon.png) 10px 11px,linear-gradient(top,#009ddc,#0079a9);background-repeat:no-repeat;width:100%;color:#fff;height:auto;text-align:center;padding: 2px;word-wrap:break-word;border: 2px solid #fff;bottom:80px;z-index:1000 }<\/em><\/code><\/p>\n<p><code><em>.alert-close{background:rgba(255,255,255,.1);-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.4),inset 0 -1px 2px rgba(255,255,255,.25);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.4),inset 0 -1px 2px rgba(255,255,255,.25);box-shadow:inset 0 1px 2px rgba(0,0,0,.4),inset 0 -1px 2px rgba(255,255,255,.25);color:#FFF;cursor:pointer;font-size:24px;font-weight:600;height:24px;line-height:20px;position:absolute;right:11px;top:9px;-webkit-transition:color .2s ease-in-out;-moz-transition:color .2s ease-in-out;-o-transition:color .2s ease-in-out;transition:color .2s ease-in-out;width:24px}<\/em><\/code><\/p>\n<ul class=\"lcp_catlist\" id=\"lcp_instance_0\"><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Due to these EU cookies laws, all the website must display a cookie warning for reader to continue or leave.\u00a0 After so much time to search for the best solution since we display Ad-sense\u00a0and Amazon ads, we need to comply and finally we found a that shows us how to do it. It&#8217;s quite simple. <a href=\"https:\/\/www.dognmonkey.com\/techs\/how-to-implement-eu-cookies-warning.html\" class=\"more-link\">&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":6949,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[288,1032,807,20],"tags":[1228,1226,1224,1227,383,1225,361],"class_list":["post-6944","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css-wordpress","category-plugins-wordpress","category-scripts","category-wordpress","tag-cdnjs-cloudflare-com","tag-close-button","tag-cookies","tag-script","tag-scripts","tag-text-box","tag-warning"],"views":212,"_links":{"self":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/6944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/comments?post=6944"}],"version-history":[{"count":3,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/6944\/revisions"}],"predecessor-version":[{"id":7500,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/6944\/revisions\/7500"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/media\/6949"}],"wp:attachment":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/media?parent=6944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/categories?post=6944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/tags?post=6944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}