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 »

Using is_front_page() in the ATO - Configure Header Area option?


  #1  
Old Dec 9, 2009, 06:33 AM
david y
 
16 posts · Dec 2009
I am trying to configure the header area differently based on whether it's the front page or not. Can I use the is_front_page() function here along with the %logo %bar1 %pages %image items on the ATO page?

i.e-

on the front page I want %bar1 %logo %bar1 %pages %image. On all others I want %bar1 %logo %bar1 %image %pages %bar2. Seems like it should work, but I'm a newbie and my coding isn't working right.

Thank you
  #2  
Old Dec 9, 2009, 10:26 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
exactly what did you code?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Dec 9, 2009, 10:47 AM
david y
 
16 posts · Dec 2009
Well I tried this in the Configure Header Area -

<?php if ( is_front_page() ){%bar1 %bar1 %logo %bar1 %pages %bar1 %image};
else {%bar1 %bar1 %logo %bar1 %image %pages %bar1 }; ?>

and of course that didn't work. After further thinking I realized that this is probably not the right spot to be having code, but I don't know. Like I said, I'm all new to this. Any help is appreciated. Thank you
  #4  
Old Dec 9, 2009, 01:00 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
yeah, you can't do it that way. Try this
HTML Code:
<?php if ( is_front_page() ){ ?> %bar1 %bar1 %logo %bar1 %pages %bar1 %image <?php };
else { ?> %bar1 %bar1 %logo %bar1 %image %pages %bar1 <?php }; ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Dec 9, 2009, 01:20 PM
david y
 
16 posts · Dec 2009
juggledad -

I tried putting that in the HTML Inserts: Header and it didn't work for me. I tried putting it in the Configure Header Area and that didn't work for me.

Where should this code be placed? Thanks,
  #6  
Old Dec 9, 2009, 01:32 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
this should work, put it in 'Configure Header Area'
HTML Code:
<?php if ( is_front_page() ){ echo '%bar1 %bar1 %logo %bar1 %pages %bar1 %image'; }
else { echo' %bar1 %bar1 %logo %bar1 %image %pages %bar1'; }; ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Dec 9, 2009, 01:51 PM
david y
 
16 posts · Dec 2009
that did the trick, thank you!
  #8  
Old Dec 9, 2009, 02:28 PM
david y
 
16 posts · Dec 2009
juggledad -

1 more question if I may -

if I wanted to use the Dynamic Headers plugin on all pages except the front page (I like the Ata rotating header on the front page), how would I replace the '%image' in your code with <?php show_media_header(); ?>.
  #9  
Old Dec 9, 2009, 02:32 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
try this
HTML Code:
<?php if ( is_front_page() ){ echo '%bar1 %bar1 %logo %bar1 %pages %bar1 %image'; }
else { echo' %bar1 %bar1 %logo %bar1'; show_media_header(); echo '%pages %bar1'; }; ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #10  
Old Dec 9, 2009, 02:42 PM
david y
 
16 posts · Dec 2009
the code you sent me yesterday for the headers works great, but for
some reason I get an 'error on page' message when I go to the pages
with the dynamic headers.

Webpage error details -

Message: Object required
Line: 51
Char: 3
Code: 0

This is the source code -

Line 48: function RotateHeaderImages(){
Line 49: if (document.body){
Line 50: HeaderImageContainer =
document.getElementById('imagecontainer');
Line 51: HeaderImageContainer.style.background =
'url(' + HeaderImages[j] + ') top center no-repeat';
Line 52: j = j + 1
Line 53: if (j > (p-1)) j=0
Line 54: t = setTimeout('RotateHeaderImages()', 10000)

If I just use the dynamic header code without the if..else code
there is no error. Any idea as to what this is?

Last edited by juggledad; Dec 10, 2009 at 04:51 PM.
  #11  
Old Dec 10, 2009, 04:53 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I just installed the plugin and tested using the code I gave above and it works fine for me.
try deactivating all but that plugin.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #12  
Old Dec 10, 2009, 05:15 PM
david y
 
16 posts · Dec 2009
I deactivated everything and I still get the error.

I'll bet "Header Image>> Rotate Header Image w/ Java Script?" is set to 0 on your setup. If you set it to rotate the header image you should get the same error I am getting
  #13  
Old Dec 10, 2009, 06:31 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
nope, what is your url
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #14  
Old Dec 13, 2009, 02:02 PM
david y
 
16 posts · Dec 2009
www.yba.com/default
  #15  
Old Dec 13, 2009, 06:31 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what page shows the error?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #16  
Old Dec 13, 2009, 06:57 PM
david y
 
16 posts · Dec 2009
on my browswe (ie8) it get the page error on every page exceptthe front page. Could it be a setting on my browser??
  #17  
Old Dec 14, 2009, 05:50 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
FOUND IT! Your image is looking for the localhost
HTML Code:
src="http://localhost/yba/wp-content/uploads/2009/11/SlidingDoor2_1500-300x258.jpg
you need to fix this

The error was there in Safari, the image came up with a ? and I wasn't thinking.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #18  
Old Dec 16, 2009, 09:52 AM
david y
 
16 posts · Dec 2009
actually that's not the error I'm in reference to. In Explorer, at the bottom left corner it says there is an error on every page except the frontpage. If you look at the source code that the error references, its the rotating header code. If I turn off the rotating feature the error goes away. If I don't use the if...else code from earlier in this thread and have rotating header on, the error goes away. Strange.
  #19  
Old Dec 22, 2009, 07:00 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
the problem is caused by this statement
PHP Code:
HeaderImageContainer.style.background 'url(' HeaderImages[j] + ') top center no-repeat'
it's because IE doesn't like the '.'s in the variable name.

I'll take a look later to see if I can find out why IE doesn't like it (don't you love browser compatibility)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #20  
Old Dec 22, 2009, 01:26 PM
david y
 
16 posts · Dec 2009
thanks very much for checking it out.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] I want to configure my WordPress blog. Xarzu Installing & running WordPress 3 Oct 27, 2009 05:50 AM
Header image area dropping down over the first post area bushtool Header configuration & styling 2 Sep 16, 2009 01:17 PM
Configure Header Area not working for me... help! agrossman Header configuration & styling 3 Aug 23, 2009 08:15 AM
Configure home page cnhzcy14 Atahualpa 3 Wordpress theme 0 Mar 17, 2009 11:37 AM
Fatal error: Call to undefined function is_front_page() kyuen New Versions, & Updating 4 Mar 1, 2009 07:19 PM


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


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