I’m not entirely sure why this isn’t working. But this piece of code does not work.
<?php
foreach ( $gallery_ids as $gallery ) {
echo '<div class="tgallery" rel="'.$gallery['gid'].'"><?php echo do_shortcode("[nggallery id='.$gallery['gid'].']"); ?></div>';
}
?>
I was guessing that maybe I’m putting the wrong quotes in the wrong place.
All the parts seperately work, as in :
- I can display the
'gid'value withecho $gallery['gid'] - I can make the div tags appear with the appropriate
rel - I can, by itself, make
<?php echo do_shortcode("[nggallery id=3]"); ?>work.
I just can’t make the entire thing appear together.
Why you put
<?php ?>inside your echo ?