Conditional Tags on Attachment Page (3 posts)

  1. fkranjce
    Posted 5 years 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.

  2. esmi
    Forum Moderator
    Posted 5 years ago #

  3. fkranjce
    Posted 5 years ago #

    <?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?

Topic Closed

This topic has been closed to new replies.

About this Topic