Slideshows and Website Visit Length…

There are many ways to keep visitors on your website for more than just a few seconds. One of the methods many websites use is a slideshow. Putting that slideshow up near the top … more specifically, the ‘header’ area of your website is a sure-fire way of making sure they see all the wonderful shots you have to show them. I decided to place a short slideshow in the header of this website. I looked in vain for a ‘plug-in’ which would do this automatically. One of them ‘broke’ my theme. Another didn’t seem to work at all. A third had such complicated instructions that even a hard-core Winnipeg WordPress Web Designer like myself gave up. Finally I just went with something I knew. I took the tried and true NextGen gallery, and created a new gallery just for the header and added the appropriately sized images to it. All that remained was to create the little piece of php code which I had to insert into the header.php file. (To edit the header.php file, click on ‘Appearance’, then ‘Edit’, then find the header.php file in the right margin and click to open and edit.)

And here’s a little hint. Before you go and delete all sorts of stuff in your header.php file, use the  comment symbols /* comments go inside here */ to comment out the stuff that is no longer needed instead of deleting it. That way if your website ‘breaks’ you can always bring back the code which you commented out.

At any rate, what I did was add one line of php code into the header file and ‘comment out’ one line – as shown below. Note, you need to find the place in your header.php file where a header image would be displayed. How do you find that? Well, If your theme is worth its salt, it will have documentation clearly indicating where this is. In my theme, the documentation was as follows:

/* ======== HEADER IMAGE ======== */
/*get_template_part(‘hdr’,’image’);*/      /*this is the original line which produced the original header*/
{ nggSlideshowWidget(3,940,198); };    /*I added this which calls the Next Gen gallery slideshow widget instead */

Note how I ‘commented out’ the original line and added the {nggSlideshowWidget (3,940,198);} line. The line I added calls up the NextGen gallery widget to create a slideshow from the gallery with an ID number of 3 and size it to 940 x 198 pixels.

Hope this helps you if you should ever want to add a slideshow to the header of your WordPress website!

About the Author: Winnipeg Web Designer

Winnipeg Web Designer