|
#1
Dec 9, 2009, 06:33 AM
|
|
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
Dec 9, 2009, 10:26 AM
|
|
|
|
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
Dec 9, 2009, 10:47 AM
|
|
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
Dec 9, 2009, 01:00 PM
|
|
|
|
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
Dec 9, 2009, 01:20 PM
|
|
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
Dec 9, 2009, 01:32 PM
|
|
|
|
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
Dec 9, 2009, 01:51 PM
|
|
that did the trick, thank you!
|
#8
Dec 9, 2009, 02:28 PM
|
|
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
Dec 9, 2009, 02:32 PM
|
|
|
|
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
Dec 9, 2009, 02:42 PM
|
|
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
Dec 10, 2009, 04:53 PM
|
|
|
|
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
Dec 10, 2009, 05:15 PM
|
|
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
Dec 10, 2009, 06:31 PM
|
|
|
|
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
Dec 13, 2009, 02:02 PM
|
|
|
#15
Dec 13, 2009, 06:31 PM
|
|
|
|
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
Dec 13, 2009, 06:57 PM
|
|
on my browswe (ie8) it get the page error on every page exceptthe front page. Could it be a setting on my browser??
|
#17
Dec 14, 2009, 05:50 AM
|
|
|
|
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
Dec 16, 2009, 09:52 AM
|
|
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
Dec 22, 2009, 07:00 AM
|
|
|
|
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
Dec 22, 2009, 01:26 PM
|
|
thanks very much for checking it out.
|
|