Support » Themes and Templates » the_title(); inside a loop/echo

  • just trying to apply the_title(); within my litebox rel. worked before I used it in a loop. im not a php buff.

    <?php
    	for($i=1; $i<6; $i++){               //loop 5 times
    	  if(get_field('image_' . $i)){       //check if there is an image on each iteration of the loop
    	echo' <a href="' . get_field('image_' . $i) . '" rel="lightbox[ the_title();]"><img src="' . get_field('image_' . $i) . '"/>';  //output results
    					}
    				}
    				?>
  • The topic ‘the_title(); inside a loop/echo’ is closed to new replies.