WordPress.org

Support

Support » How-To and Troubleshooting » How to call gallery from post parent in image.php template

How to call gallery from post parent in image.php template

  • I am trying to load the gallery from the post parent on an attachment page but can’t seem to get it to load properly. Here is what I’m using

    <?php echo do_shortcode('[gallery id="<?php the_ID($post->post_parent); ?>"]'); ?>

    Is there anyway to call it without using the shortcode?

  • The topic ‘How to call gallery from post parent in image.php template’ is closed to new replies.
Skip to toolbar