Specific image rotation on page?
Is it posssible to set up the header image so that is loads from a different directory of header images (still random) but specific to the active page? so images/headerhome would be one set of images and images/headerpageone would be a different set of images?
|
You could muck with header.php and copy the existing code and add a is_page(..) to identify the page you want the new code on and the directory to grab the images from
|
This is nearly a month old, but because I wanted to have this solved for a website of myself and juggledad showed the right direction, I thought I'll just post what I did to make that work:
Edit "bfa_rotating_header_images.php" from Atahualpa's "functions" folder. Look for this code: PHP Code:
PHP Code:
To find out the IDs of pages, I use the WP-Plugin "Reveal IDs for WP Admin", which is handy. Hope that helps. P.S.: If there is a better way which will preserve the extra code after updates, I'd be happy to hear. |
Thank you Zagato!
It works. Now, I only use my website as a 'traditional' website and not a blog. I would like to have a different headerimage on each page. I thought I could use your idea but then only have one image in the folder you call 'special'. Then I would obviously have to create many folders within the 'header' folder. I tried to copy paste your code and create a new code for each 'special' folder. Something like this: if (is_page('11')) { $imgpath = TEMPLATEPATH . '/images/header/special1/'; $imgdir = get_bloginfo('template_directory') . '/images/header/special1/'; if (is_page('12')) { $imgpath = TEMPLATEPATH . '/images/header/special2/'; $imgdir = get_bloginfo('template_directory') . '/images/header/special2/'; if (is_page('13')) { $imgpath = TEMPLATEPATH . '/images/header/specia3/'; $imgdir = get_bloginfo('template_directory') . '/images/header/special3/'; } else { $imgpath = TEMPLATEPATH . '/images/header/'; $imgdir = get_bloginfo('template_directory') . '/images/header/'; } But it certainly doesn't work! (And I know that I am very new to this stuff!) Do you have an idea of how I can solve my problem with having different header image for each page and sub-page I create? Thank you a bunch on beforehand, Lukas www.friland.org/wordpress (a page in progress. just mock-up for now) |
All times are GMT -6. The time now is 07:57 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.