Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have been searching for the answer on this, and still haven't found something that works. Could someone kindly let me know how to exclude the following code from all the picture attachment pages of Wordpress? This code is currently in my single.php file so that I can manage it from a central location. I don't know a whole lot about code so any information you can provide is greatly appreciated.

Thanks in advance!

`<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<p style="padding-left: 15px;"><a class="addthis_counter addthis_pill_style"></a>
&#x00A0;<a class="addthis_button_facebook_like" fb:like:layout="button_count">&#x00A0;</a>
&#x200B;<a class="addthis_button_tweet">&#x200B;</a>
<a class="addthis_button_pinterest_pinit"></a>
<class="addthis_toolbox addthis_default_style"> 
<a class="addthis_button_linkedin_counter" li:counter="none"></a>  
&#x00A0;<a class="addthis_button_google_plusone" g:plusone:count="false">&#x00A0;</a>
</div></p>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-518895bb724be09b"></script>
<!-- AddThis Button END -->`
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Not tried this myself, but try adding

<?php if ( ! is_attachment() ) { ?>
all your current stuff
<?php } ?>
share|improve this answer
    
Perfect! Thank-you so, so much as you have ended so much frustration for me! –  user2376452 Jul 4 '13 at 21:01
    
If you are satisfied with the answer, please mark it as correct (click the tick) so other people know. –  vancoder Jul 4 '13 at 21:04
    
Yes, thank-you, there was a mandatory waiting period, but I have it now! :-) –  user2376452 Jul 4 '13 at 21:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.