Reputation: 77
I am trying to place a "back to home" button on all of the pages except the home page on a Wordpress site. I have successfully placed the item on all pages but cannot figure out how to remove it from the home page. I know that I probably need to use conditional tags but haven't worked with them much.
Here is the code I used in header.php:
<div class="outer"><a href="http://s416809079.onlinehome.us/"><img src="http://theshalomimaginative.com/testsite/wp-content/themes/pilot-fish/images/Untitled-1.png"/></a></div>
What would I need to use to have the image not on the homepage?
Any help in how to do this would be great! Thanks!
Here is the link to the site: http://s416809079.onlinehome.us/
Upvotes: 0
Views: 204
Reputation: 2850
Use is_home()
or is_front_page()
. Which works depends on some peculiarities of your theme and your configuration. You'd have:
<?php
if (!is_home()) { ?>
<div class="outer"><a href="http://s416809079.onlinehome.us/"><img src="http://theshalomimaginative.com/testsite/wp-content/themes/pilot-fish/images/Untitled-1.png"/></a></div><?php
} ?>
Or the same with is_front_page()
.
Upvotes: 1
Reputation: 3982
You should change of parameter CSS data in CSS files for property .outer
.
div.outer img
{
width: 300px;
height: 300px;
float: left;
left: 10px;
top: 10px;
}
Upvotes: 0