WordPress.org

Support

Support » How-To and Troubleshooting » <?php echo do_shortcode(‘[gallery]‘); ?> on image.php not showing anything?

<?php echo do_shortcode(‘[gallery]‘); ?> on image.php not showing anything?

  • I’d like to show the entire gallery of images on each image page (image.php). I’m using the following code:

    <?php echo do_shortcode('[gallery]'); ?>

    Yet the gallery it does not show. It’s in the loop.

    Any ideas?

Viewing 1 replies (of 1 total)
  • Hi, make sure you have write/load [gallery] also in your post, because only writing it in the template won’t work.

    This ‘order’ just search for the shortcode in the post while the loop starts, to put the gallery elsewhere.

    I give this answer ’cause I’m pretty able to forget it 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘<?php echo do_shortcode(‘[gallery]‘); ?> on image.php not showing anything?’ is closed to new replies.
Skip to toolbar