user2062182
user2062182

Reputation: 1

if is_post to affect only all posts not pages in WordPress

I'm using WordPress 3.5.1. I have put a litlle picture in the bottom of each page excluding a few by is_page('') if statement in footer.php When i write in the is_post condition it removes the pictures from all the pages too!

Is there a way to exclude this picture only from all posts?

Tried is_single to no avail...

Hope you cold help. Thanks!

Upvotes: 0

Views: 3142

Answers (2)

user2062182
user2062182

Reputation: 1

Fixed by using is_single instead.

Upvotes: 0

jberculo
jberculo

Reputation: 1113

I'm not exactly sure what you are trying to accomplish. But for instance, if you'd like to put a picture on every page that is of post_type page, you could do it as follows:

<?php if (is_page()): ?>
<img src="image_source" />
<?php endif; ?>

Doing is_page('') will probably not work, as it will search for a page with an empty title or slug.

Upvotes: 1

Related Questions