How To Create Snow Effect in WordPress?
Introduction
Hey, everyone! Welcome back to the channel for another exciting tutorial. As we approach the new year and the winter season, I’ve got a special treat for you – a way to add a charming snow effect to your WordPress website without the need for plugins or complicated JavaScript code. Just Follow along as I guide you through the simple process using basic CSS code.
Download Snow Assets
Visit the Google Drive link provided in the video description to download the three snow image assets. These assets will be the key to creating a delightful snowfall on your website.
Upload Assets to WordPress Media Library
Head to your WordPress dashboard and navigate to the Media Library. Upload the downloaded snow files to your library.
Copy CSS Code
Copy the CSS code provided in the video description. This code will reference the URLs of the uploaded snow assets.
Update CSS Code with Asset URLs
Paste the copied code into your preferred code editor. Replace the placeholder URLs with the actual URLs of the uploaded snow assets. This will link the CSS code to the images.
Add CSS Code to WordPress
If your theme has an “Additional CSS” option, navigate to Appearance > Customize > Additional CSS and paste the code. Alternatively, if your theme lacks this option, use the theme file editor to insert the code into the style.css file.
body {
position: relative;
background:#d2d2d2;
}
body:after {
content: '';
display: block;
position: absolute;
z-index: 2;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
background-image: url('https://websensepro.com/youtube/wp-content/uploads/2023/12/snow1.webp'), url('https://websensepro.com/youtube/wp-content/uploads/2023/12/snow2.webp'), url('https://websensepro.com/youtube/wp-content/uploads/2023/12/snow3.webp');
animation: snow 10s linear infinite;
}
@keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
50% {background-position: 500px 500px, 100px 200px, -100px 150px;}
100% {background-position: 500px 1000px, 200px 400px, -100px 300px;}
}
Image Assets:
https://drive.google.com/drive/folders/1p5fv5oTdc6V67MkYW1S2pQssLWr6Oa9b?usp=sharing
Conclusion
That’s it! You’ve successfully added a captivating snow effect to your WordPress website, bringing in the festive vibes. Remember, you can find the code and asset links in the blog post linked in the video description.