Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

Header Images - One fixed image for Home Page - Rotate all images on all other pages?


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Sep 14, 2010, 09:53 AM
ClearlyRobert
 
20 posts · May 2010
Header Images - One fixed image for Home Page - Rotate all images on all other pages?

Is there a way to do this?

TIA
  #2  
Old Sep 14, 2010, 10:48 AM
lmilesw's Avatar
lmilesw
 
10,097 posts · Jul 2009
Central New York State USA
You would have to set up a conditional to display an image on the home page and %image on all the others. Something like the following.
HTML Code:
<?php if( is_home() ) { ?>
<img src="http://path-to-image.jpg" />
<?php } else { ?>
%image
<?php } ?>
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Sep 15, 2010, 08:44 AM
ClearlyRobert
 
20 posts · May 2010
Thanks for the response....

Is this the same approach if I wanted to use a specific image as a header for each of my 8-10 pages? Also, where do I use this code? On one of the theme set up pages?

Apologies for the newbie questions.

Robert
  #4  
Old Sep 15, 2010, 11:21 AM
lmilesw's Avatar
lmilesw
 
10,097 posts · Jul 2009
Central New York State USA
Yes... The code would be
HTML Code:
<?php if( is_page('33') ) { ?>
<img src="http://path-to-image1.jpg" />
<?php elseif ( is_page('4') ) { ?>
<img src="http://www.cnybiz.com/wp-content/themes/atahualpa353/images/backgr.gif" />
<?php elseif( is_page('34') ) { ?>
<img src="http://path-to-image2.jpg" />
<?php } else { ?>
%image
<?php } ?>
where 33 is the ID of the page.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #5  
Old Oct 11, 2010, 04:02 PM
Tyran
 
8 posts · Sep 2010
Where would this code be used exactly?
  #6  
Old Oct 11, 2010, 04:54 PM
juggledad's Avatar
juggledad
 
22,244 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
it would go in ATO->Style & edit HEADER AREA->Configure Header Area
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Oct 12, 2010, 08:44 AM
Tyran
 
8 posts · Sep 2010
I tried that and ended up with no header at all. I'll give it another try and see if I can figure out why.
  #8  
Old Oct 12, 2010, 09:34 AM
juggledad's Avatar
juggledad
 
22,244 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
Tyran - you probably have a coding error. post the code you used
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Oct 12, 2010, 10:28 AM
Tyran
 
8 posts · Sep 2010
lmilesw's code above actually contains the error. Corrected example code below:

Quote:
<?php if( is_page('33') ) { ?>
<img src="http://path-to-image1.jpg" />
<?php } elseif ( is_page('4') ) { ?>
<img src="http://www.cnybiz.com/wp-content/themes/atahualpa353/images/backgr.gif" />
<?php } elseif( is_page('34') ) { ?>
<img src="http://path-to-image2.jpg" />
<?php } else { ?>
%image
<?php } ?>
  #10  
Old Oct 12, 2010, 10:50 AM
Tyran
 
8 posts · Sep 2010
The main problem with the original code is that it does not properly (as in it doesn't do it at all) insert the blog name or tag line. The code below inserts the image into the block created by %image:

HTML Code:
<?php if( is_page('29') ) {
	$HeaderURL="http://www.shantayoga.com/wp-content/themes/shanta/images/header/header.jpg";
	$CustomHeaderImage = 1;
} elseif ( is_page('22') ) { 
	$HeaderURL="http://www.shantayoga.com/wp-content/themes/shanta/images/header/header-nidra.jpg";
	$CustomHeaderImage = 1;
} else {
	$CustomHeaderImage = 0;
} ?>


<?php if( $CustomHeaderImage == 1 ) { ?>
<div id="imagecontainer" class="header-image-container" style="background: url('<?php echo $HeaderURL; ?>') top center no-repeat;">
<div class="clickable"><a class="divclick" title="Shanta Yoga" href ="http://www.shantayoga.com/">&nbsp;</a></div>
<div class="titleoverlay"><h2 class="blogtitle"><a href="http://www.shantayoga.com/">Shanta Yoga</a></h2>
<p class="tagline">Live with Ease</p></div></div>
<?php } else { ?>
%image
<?php } ?>
  #11  
Old Oct 12, 2010, 12:12 PM
lmilesw's Avatar
lmilesw
 
10,097 posts · Jul 2009
Central New York State USA
Sorry about the missing }. The code I mentioned was only intended for the images. Where did you want your blog title and tag line to be displayed?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating Header Images link to Different pages instead of home page? WordPressZen.com Header configuration & styling 10 Oct 13, 2010 12:41 PM
3.5.1: Header images always rotate in the same sequence... not great! cfibanez Header configuration & styling 4 Jul 26, 2010 07:34 AM
[SOLVED] Need header images to rotate in specified order bretsallee Header configuration & styling 3 Jun 14, 2010 10:50 AM
Fixed HeaderImage for Home Page & then Rotating Header Images for other pages? kippiper Header configuration & styling 6 Jun 29, 2009 06:47 AM
Header Images Fail to Rotate Yarrokon Header configuration & styling 10 Jun 8, 2009 10:17 AM


All times are GMT -6. The time now is 09:07 AM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.