I have this if else statement that gives me an <img src=""..../> element as result. My problem is that i want the statement to give me a result as <li><img src=""..../></li>
I could just wrap the if stament around the <li> element but that would loose the purpose of what im trying to do. Is there any way i can add the <li> elements inside the if statement ?
Function
<?php if(class_exists('MultiPostThumbnails')
&& MultiPostThumbnails::has_post_thumbnail('post', 'secondary-image')) {
MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image', NULL, 'post-secondary-image-thumbnail');
}else {
} ?>
result
<img src="..."/>
desired result
<li> <img src="..."/></li>
The source code is
if (class_exists('MultiPostThumbnails')) {
new MultiPostThumbnails(array(
'label' => 'Secondary Image',
'id' => 'secondary-image',
'post_type' => 'post'
) )
;new MultiPostThumbnails(array(
'label' => 'third Image',
'id' => 'third-image',
'post_type' => 'post'
) );
}
MultiPostThumbnails::the_post_thumbnailas that seems to be producing the output