Viewing 1 replies (of 1 total)
  • I don’t know of a way to have two (or more) attachment templates, but if there is something in these “posts” which can act as a trigger, you can use that to modify the template to suit.

    For example, let’s say you insert an HTML comment like:

    <!--ad-->

    in the description of an image attachment. A small bit of PHP can look for it in the description (technically, the post_content field of the attachment):

    <?php
    if( strstr('<!--ad-->',$post->post_content) ) :
    ?>
    ~ attachment advert stuff goes here ~
    <?php endif; ?>

    Note something like this is aimed at running within The Loop, where the $post object is put to work.

Viewing 1 replies (of 1 total)
  • The topic ‘How do I use 2 different attachment.php pages?’ is closed to new replies.