1. I tried it several times, and many combimnations, still nothing
2. there is no function get_the_title in single.php, I only see echo the_title 3 times
[ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]
?php if ($popup == 'On') { ?><a>" rel="prettyPhoto[pp_gal]" title="<?php if ($alt) { echo str_replace('"', "", $alt); } else { echo the_title(); } ?>"><?php }?><img src="<?php echo $thumb[0]; ?>" alt="<?php if ($alt) { echo str_replace('"', "", $alt); } else { echo the_title(); } ?>" title="<?php print_r($caption); ?>" class="scale-with-grid" data-thumb="<?php echo $thumb[0]; ?>"/><?php if ($popup == 'On') { ?></a><?php }?>
<?php $counter = 2;
while ($counter < ($thumbnum)) :
if ( ${'thumb' . $counter}) : ?>
<?php if ($popup == 'On') { ?><a>" rel="prettyPhoto[pp_gal]" title="<?php if (${'alt' . $counter}) { echo str_replace('"', "", ${'alt' . $counter}); } else { echo the_title(); } ?>"><?php }?><img src="<?php echo ${'thumb' . $counter}[0]; ?>" alt="<?php if (${'alt' . $counter}) { echo str_replace('"', "", ${'alt' . $counter}); } ?>" title="<?php if (${'caption' . $counter}) { echo str_replace('"', "", ${'caption' . $counter}); } ?>" class="scale-with-grid" data-thumb="<?php echo $thumb[0]; ?>"/><?php if ($popup == 'On') { ?></a><?php }?>
<?php endif; $counter++;
endwhile; ?>
</div>
</div>
</div>
<?php endif;