converting html into php conditional statement

I am using a wordpress plugin that requires the following code in my template:

<li><a href="#"><?php if (class_exists('MultiPostThumbnails')
                    && MultiPostThumbnails::has_post_thumbnail('shanti', 'two-image')) : MultiPostThumbnails::the_post_thumbnail('shanti', 'two-image', NULL,  'big'); 
                endif; ?></a></li>

Basically, it says “if the MultiPost Thumbnails class exists, then display the ‘big’ image.” Im not too great with PHP, but I would like to include the <li><a href="#"> within the conditional statement. Reason is because if there is no image to spit out, I dont want a blank <li> to be displayed. Any idea how to rewrite this code to include the <li>/<a> in the conditional?

Read More

Thanks

Related posts

Leave a Reply

1 comment

  1. Try advanced escaping:

    <?php if (class_exists('MultiPostThumbnails')
                    && MultiPostThumbnails::has_post_thumbnail('shanti', 'two-image')): ?>
    <li><a href="#">
        <?php MultiPostThumbnails::the_post_thumbnail('shanti', 'two-image', NULL,  'big'); ?>
    </a></li> 
    
    <?php endif; ?>