Here is something which I wanted to do with WordPress for a while now. In the sidebar, I wanted to remove the ecommerce seals for the SSL certificate and PayPal from the main blog entries and only have them display for the WordPress Pages. This is where The WordPress Codex comes in handy and explains how WordPress Conditional Tags can be used to display content based on what page the reader is currently viewing. There is even a code sample for the sidebar.
In my case, though it was really simple, I just added the html code for the gifs into a php section, similar to this:
<?php if (is_page()) {
echo "<img src="http://www.site.com/logos/paypal.gif" />";
}
?>
However note, that this code will not work! If you notice, that the echo statement uses double-quotation marks and that the html code does as well, you will realize that in order for this code to work, you have to escape the quotation marks in the html by using the backslash.
Therefore the correct code would look like this.
<?php if (is_page()) {
echo "<img src=\"http://www.site.com/logos/paypal.gif\" />";
}
?>
The is_page tag is used in this case to mean that if I am on a WordPress Page, then include the html in the echo command. To add more html code, I would just add another echo command, making sure I enclosed it in quotes, and that I escaped any quotes in the html with a backslash, and finally in PHP, you have to end each command with a semicolon.
For further information on conditional tags see the WordPress Codex.