PDA

View Full Version : Image in header


sybarites
February 25th, 2006, 02:27
How would I have my header be an image and every time you go to the site it is a different image. Thank You

www.sybarites.org

Aergonaut
February 25th, 2006, 04:35
I'd suggest first reading this article (http://www.alistapart.com/articles/randomizer/) from A List Apart about implementing a PHP-based image rotator.

Then open up header.php and add this, somewhere near the closing head tag:

<style type="text/css">
#header {
background-image: url("/path/to/images/rotator.php");
}
</style>

Of course, replace /path/to/images/rotator.php with the actual path to where you placed rotator.php. The above article will tell you where to place it. I think this method should work.

sybarites
February 25th, 2006, 05:14
How would I put that into Wordpress?

Aergonaut
February 25th, 2006, 05:28
You should first read the article and follow the steps it lists. Once you've made the rotator.php it describes, place that in the directory you're putting your header images in.

Then open up header.php in a text editor and add the code I listed above. Be sure to change /path/to/images/rotator.php so that it actually points to where you put rotator.php. That is, replace /path/to/images with the proper path to the directory where you're storing the images on your server.

Save everything and upload the new header.php file and things should work.

sybarites
February 25th, 2006, 07:35
Ok it worked what size is the header bar in pixels?

thanks

ramlev
February 25th, 2006, 07:42
I have made a plugin for the k2 theme, you can find it here http://ramlev.dk/wp-plugins/

With this plugin, it's possible to upload, manage which picture you want to see, you can randomize, and other things.

Happy browsing

Kind Regards
Hasse Ramlev Hansen
www.ramlev.dk

AlexF
February 26th, 2006, 01:36
I have made a plugin for the k2 theme, you can find it here http://ramlev.dk/wp-plugins/

D/l'ed your plugin but not sure where to place the images folder. Under plugins, it does not seem to save the images and causes the header to be white.

Any suggestions?

sdimbert
February 26th, 2006, 02:24
Paul wrote a series of three fantastic articles about customizing K2, and this question is answered in one of them. Look here. (http://www.paulstamatiou.com/2005/12/28/customizing-k2-part-1/)

Also, I have not yet tried the plug-in that ramlev made (and I plan to!), but if you follow Paul's advice, you should make the changes via a custom theme css file, instead of permanently in your header.php. It's cleaner and makes it easier to upgrade K2.

sdimbert
February 26th, 2006, 02:32
OK. I changed my tune... ramlev's plugin is awesome. It should be a standard piece of K2. You hearing me, MH? :)

ramlev
February 26th, 2006, 04:16
You should unzip the archive in the plugins folder
plugins/k2-picupload
plugins/k2-picupload/images
plugins/k2-picupload/images/headers

and remember to chmod the images/headers folder to 777, and then it should work like a charm.

AlexF
February 27th, 2006, 02:28
ramlev,

Thanks! The latest update corrected my previous issues. I have also added a few feature requests via your tracking software that hopefully you could incorporate.

Regards,
Alex
http://fulltimefishing.com