Does anyone know if its bad practice to do the below? If so is there an alternative to what I’m trying to achieve? (below is a simplified version of what I would be using)
<?php $projectTitle = "my title"; ?>
<h3><?php echo $projectTitle ?></h3>
<img src="bla.jpg" title="<?php echo $projectTitle ?> />
<img src="bla2.jpg" title="<?php echo $projectTitle ?> />
<img src="bla3.jpg" title="<?php echo $projectTitle ?> />
<?php $projectTitle = "my updated title"; ?>
<h3><?php echo $projectTitle ?></h3>
<img src="bla.jpg" title="<?php echo $projectTitle ?> />
<img src="bla2.jpg" title="<?php echo $projectTitle ?> />
<img src="bla3.jpg" title="<?php echo $projectTitle ?> />
and so on. Basically I want to just add for each project block the title once and have it carry out to where its called below until the next project where the project title would change.
I have tested this out and it works fine, but I’m not sure if there will be any unforeseen consequences or if there is a better way.
It’s okay. It makes your life easier and causes no harm at all