Posted on Leave a comment

Notification Bar Without Plugin 1kb Simple Paste Code

Most of the cookie WordPress plugins consent unwanted script and code, final will slow down your site web performance, and website loading time boot download too many scripts and unwanted CSS and JavaScript. I found a single line of code paste it and work better than WordPress Plugin.

Using this code for notification bars in WordPress can great way to announce things, increase your engagement. So follow this tutorial below on how to create a WordPress notification bar without a plugin, and therefore not affect your performance!

Here is how it looks:

<style>.note-left{ float: left; padding: 7px 0px;color: #313131;} #cookies-bar{color: #fff; font-family: inherit;background: #f5f5f5;padding: 15px 23px;position: fixed;bottom: 0;left: 0;width: 100%;margin: 0px;visibility: hidden;z-index: 99999;box-sizing: border-box;box-shadow: 0 -7px 19px -9px #000000c9;}.acpt-rgt{padding: 8px 12px;background: #397aff;border-radius: 8px;float: right; cursor: pointer;}</style>

<p id="cookies-bar"><span class="note-left">We use cookies to offer you a better browsing experience</span><span class="acpt-rgt" onclick="acceptCookie(); return false;">Accept cookies</span></p>

<script>function acceptCookie(){ document.cookie="cookiesclick=1; expires=Fri, 26 Dec 2025 12:00:00 UTC;path=/", document.getElementById("cookies-bar").style.visibility="hidden"; return false; } document.cookie.indexOf("cookiesclick")<0&&(document.getElementById("cookies-bar").style.visibility="visible"); </script>

Paste Code:

Here is the HTML, CSS and JavaScript, use for notification bar cookies. You will want to put in right location bellow mention.

Login wp-admin → Appearance → Theme Editor → footer.php

Now you can enjoy a super fast notification bar without Plugin, no heavy scripts or animations. If this tutorial on Create WordPress Notification Bar Without Plugin Simple Paste Code, please let me know below.

Leave a Reply

Your email address will not be published. Required fields are marked *