Support » Fixing WordPress » Conditional Tags on Attachment Page
6 years, 6 months ago
Is it somehow possible to use conditional tag on attachment page.
What i need…
Post is in category #1. With conditional tags i than hide ads from all posts in that category but images (in attachment page) in those posts still shows ads.
Is it possible to tell that image is connected with that post (it should as it is used in post) and that is is under that category.
<?php if( !in_category(‘257’) ) : ?>
<?php endif; ?>
I use that code in header.php but when i click on image attached to post in category 257 it don’t work. It don’t behave like that image is in category 257.
Any way to test if image is attached to post in specific category?