sileesworkshop
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Different header images for pages?I can’t get this to work.
where do you put this code?
I’ve tried like this in the header.php, but it doesn’t work, it shows just empty headerspace:
#header { background: url(<?php if (is_page('7') ): ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/tdvheader01.jpg" alt='Uitmarkt' />
<?php elseif (is_page('8') ): ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader.jpg" alt='alt8' />
<?php else : ?>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader.jpg" />
<?php endif; ?>) no-repeat bottom center; }
I replaced the original
#header
with this.
Any tips?
Thanks alreadyForum: Fixing WordPress
In reply to: Header per category / page / homeThis post has been helpfull to me sofar, but i didn’t get my site to work proparly yet.
I’ve put the code underneed in the header.php, and it work, but the allignment of the image isn’t right. The main headerimage shows underneed as well.<!--
<div id="header"
onclick="location.href='<?php echo get_settings('home'); ?>/';" style="cursor: pointer;">
<?php if ( is_page(7) ) : ?><img src="<?php bloginfo('stylesheet_directory'); ?>/images/tdvheader01.jpg">
<?php endif; ?>
-->So i’ve been trying to put the code in a different place in the header.php, like this:
<!--
#header {
<?php if(is_home) background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader.jpg") no-repeat bottom center;
elseif(is_page(7)) background: url("<?php bloginfo('stylesheet_directory'); ?>/images/tdvheader02.jpg") no-repeat bottom center;
elseif(is_page) background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader.jpg") no-repeat bottom center;
?>"> }
-->I get parse errors with this, so my knowledge of code and php isn’t good enough.
Can someone help me out here with this code, or could someone spell out where to put the code discussed in this thread previously. I’ve tried the code Podz stated, and made the .header1, etc in my style.css, but no result, and parse errors.NB. My site needs a header on the home and the same one on most pages, but some pages need a customheader.
Thanks already.