Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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?


  #1  
Old Sep 14, 2010, 10: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, 11:48 AM
lmilesw's Avatar
lmilesw
 
10,176 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, 09: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, 12:21 PM
lmilesw's Avatar
lmilesw
 
10,176 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, 05:02 PM
Tyran
 
8 posts · Sep 2010
Where would this code be used exactly?
  #6  
Old Oct 11, 2010, 05:54 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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, 09: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, 10:34 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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, 11: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, 11: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, 01:12 PM
lmilesw's Avatar
lmilesw
 
10,176 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 01:41 PM
3.5.1: Header images always rotate in the same sequence... not great! cfibanez Header configuration & styling 4 Jul 26, 2010 08:34 AM
[SOLVED] Need header images to rotate in specified order bretsallee Header configuration & styling 3 Jun 14, 2010 11:50 AM
Fixed HeaderImage for Home Page & then Rotating Header Images for other pages? kippiper Header configuration & styling 6 Jun 29, 2009 07:47 AM
Header Images Fail to Rotate Yarrokon Header configuration & styling 10 Jun 8, 2009 11:17 AM


All times are GMT -6. The time now is 06:40 PM.


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