Wordpress essentials: animated snowy Christmas header
Posted by Roland | Posted in Tutorials | Posted on 02-12-2009
13

Howdy, my dear frieds
Have you mentioned something? Yep... That's a snowy mood I added to my blog
Come on, it's already December outside and the Christmas is coming
with a lot of preparing for exams stuff
Anyway, I don't want to think about sad things and let me tell you, how did I manage to put a snow to Wordpress header
For lots of designers it's not a secret, how to put flash objects into header. For me it was...till the day I found out how can I do that.
And additional knowledge of how z-index property works gave me a possibility to put flash object on background not covering my buttons. I could put this snowy background on the whole webpage, but I don't want to
So, today I'm going to tell you about how I did that, maybe it will be usefull for somebody
So, lets start
First thing you have to do is to download a snowy flash movie.
I used a Flash snow banner from FFILES.com, but as I didn't need the rest except snow, I modified it a bit. Modified version can be downloaded here.
I modified only two things - removed all objects except snow flake and added three lines of code:
Stage.align = "TL"; Stage.scaleMode = "noScale"; stop();
Explaining the code, I made a Stage.align to the Top Left corner (what is actually not needed at all, just a bad habbit of mine) and told flash not to scale the contents of the movie by Stage.scaleMode = "noScale"; command. By this I got a movie clip, what can be resized no matter how and the snowflakes will not be resized
Now, if you downloaded my version, just extract it somewhere and don't forget where you've extracted it. Cause I forgot several times and it was easier to download a new copy, than to find something in my PC
Next thing you will have to do is login to your Administrator panel and install a plug-in called "SWFObject". That's how we will embedd our flash movie. We also need to configure it a bit. You can configure it by yourself but I recommend using my configuration just to be sure that everything works. Click on image to view full size.
Now go to your Media Library and Add New file. Upload the snow_header.swf and copy the direct url to uploaded file.
It has to be something like:
http://yourname.com/wp-content/uploads/2009/12/todaysdate_snow_header.swf
But it can be different as well. Just be sure you copied it correctly. I know you not dumb, but anything can happen. Paste this url to some notepad, cause we need that after several steps.
Copy the code below:
<div style="position:absolute; top: 0px; right: 0px; left: 0px; z-index: 1;">
<?php wp_swfobject_echo(" FILE URL ", " WIDTH ", " HEIGHT "); ?></div>
And replace the strings FILE URL, WIDTH and HEIGHT. My width was 100% and height was set to 450.
Note, that if your width isn't 100%, then you'll need to modify the div style tag a bit. Instead of right: 0px; left: 0px; you would better write margin-left: auto; margin-right: auto; That will center your div. And of you don't need your div to be placed in some another way, then you have to know better, how you will position the flash movie.
Now insert this code into your header.php file right after <body> tag. Ok then, you're almost done. If you test your website now, it already has to show you the snow. But, sometimes it doesn't happen, or happening behind other elements
Here is the moment you should turn on your brains and imagination. The problem is in layout and more often is in z-index properties set in your theme css file.
In my case everything was simple. I had no z-index properties at all and all I need to do is to set a z-index property for flash movie (z-index: 1; - meaning that all other elements are z-index:0 by default) and for buttons I really need to be clickable set z-index to something higher than 1, I've chosen 999
Yeah, that's totally bigger, than 1
Somehow, not all elements came in front of my flash movie. After looking a bit at my CSS file I suddenly understood. z-index property won't work if your element has no position value. And here you go:
<div id="top_rss" style="position:relative; z-index: 999;">That's the place where RSS button is placed</div>
And now I have a really cool and dynamic snowy header and all buttons functioning in all browsers. I actually didn't check the IE 6, cause I think, that it's a really old one and if somebody is sitting on that, then I don't care
So, hope you liked it and it will be useful for you
Cheers!
Related posts:
- Adding additional page with own sidebar to Wordpress Template Howdy, People from all over the world How are...
Related posts brought to you by Yet Another Related Posts Plugin.




Thanx. Merry Christmas ;0)
Like or Dislike:
0
0
You’re welcome
Merry Christmas you too
Like or Dislike:
1
1
[…] Read the original post: Wordpress: Animated Snowy Header | rl Creative […]
Like or Dislike:
0
0
[…] This post was Twitted by ad_web […]
Like or Dislike:
0
0
Social comments and analytics for this post…
This post was mentioned on Twitter by rl_creative: Wordpress essentials: animated snowy Christmas header — http://bit.ly/6k0z7d #design #wordpress #Christmas #header #flash…
Like or Dislike:
0
0
[…] This is a great way to add winter effect to your blog. You can add amazing snow effect to your blog by following this tutorial – Wordpress essentials: animated snowy Christmas header. […]
Like or Dislike:
0
0
[…] In: Wordpress plugins 12 Dec 2009 Go to Source […]
Like or Dislike:
0
0
Great work! thanks for sharing =)
Shurandy Thode´s last blog ..Favorite Caricature of 2009 — #1 [Digg]
Like or Dislike:
0
0
Thanks
I’m glad you liked it.
Like or Dislike:
0
0
simply but powerfull — i like it
merry christmas
Like or Dislike:
0
0
Thanks and Merry Christmas !!!
Like or Dislike:
0
0
Cool tutorial! Thank’s for sharing!
Happy new year!
Serghei´s last blog ..WPSMASH’s Special Offer for Christmas
Like or Dislike:
0
0
Thanks buddy… I always wondered how this works…
Like or Dislike:
0
0