Hi I'm developing a wordpress custom page theme, I've incorporated the code. It is possible to method to dynamically add their email list products. Within the code I grab each image associated with its publish with screenshot1 screenshot2 the like... All of this presently works. My issue is in the current moment basically upload 2 screen shots 3 list products can have up and also the third will you need to be blank. Just how could I dynamically add them in line with the quantity of images within the publish?

query_posts('cat=3'); /*--Query to grab Projects categorie--*/

while (have_posts()) : the_post();  /* --- loop through the posts in that categorie */

<ul>

<?php
$screen1 = get_post_meta($post->ID, 'screenshot1', true);
$screen2 = get_post_meta($post->ID, 'screenshot2', true);
$screen3 = get_post_meta($post->ID, 'screenshot3', true);
echo "<li>" . wp_get_attachment_image($screen1, 'large') . "</li>"; 
echo  "<li>" . wp_get_attachment_image($screen2, 'large') . "</li>";
echo  "<li>" . wp_get_attachment_image($screen3, 'large') . "</li>";
?>

</ul>

Loop with the possible meta values and just output it when not empty.

Something similar to:

<ul>
<?php
$i = 1;
while ($screen = get_post_meta($post->ID, 'screenshot'.$i , true)) {
    echo "<li>" . wp_get_attachment_image($screen, 'large') . "</li>"
    $i++; 
}
?>
</ul>