different image in different pages
-
Hi there,
I’m fairly new to wordpress, but able to convert html to a wordpress site.
Now, i’m facing a problem with WordPress. I checked tho docs and tried a lot, but not with a satisfied outcome.
I have a site with a main header on the front-page. This is actually a slider. This works. But for the inner-pages, I want no slider, so I created an “inner-header.php file and linked that to each “inner-page” template. So far, so good.
This inner-header, does have an image on the right side. That image have to be changed when browsing to another page. So each page must have it’s own image in its header.I tried the following, but it isn’t working:
<?php if (is_page('services')) { ?> <img src="<?php bloginfo('template_directory')?>/images/exper.png" alt="" /> <?php } elseif (is_page('portfolio')) { ?> <img src="<?php bloginfo('template_directory')?>/images/exper1.png" <?php } elseif (is_page('portfolio')) { ?> <img src="<?php bloginfo('template_directory')?>/images/exper1.png"
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum’s parser.]
What i’m doing wrong and how to get it work?
Thanks in advanced.
- The topic ‘different image in different pages’ is closed to new replies.