How Do I Add a Cookie Pop Up in WordPress?

Adding a cookie pop up in WordPress is relatively simple. The first step is to create a new file in your theme directory (in this case, wp-content/themes/your_theme) called CookiePopUp.

php. Within this file, you’ll need to include the following code:.

Once this code has been included, you’ll need to create a new file called CookiePopUp.php within this theme directory and include the following code:

add_action( ‘wp_enqueue_scripts’, ‘cookie-popup’ );

Now all you need to do is add the following code to your post or page where you’d like the cookie popup to appear:

And that’s it! Your cookie popup will now be available on your WordPress site.