Thanks for the tip!
With the information sent it worked partially, as the texts were not displayed. So I kept the title and img tags and worked perfectly.
” title=”<?php echo ‘#slidecaption’.$n ; ?>”/>
The error was in the “alt” tag.
Thanks a lot for the help! God bless!