[resolved] Link to Post Parent from Attachment Page (2 posts)

  1. cameraphonic
    Posted 7 years ago #

    I am trying to use the Gallery Shortcode to display all thumbnails underneath the large preview of an image on the attachment page.

    Problem is I am having is I can't seem to figure out how to get it to echo the post parent ID.

    Here is the shortcode I am using, it only echos images that are in the main library of the Media section that are not attached to a post.

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

    For example, I am trying to get the gallery of this post : http://www.sunboil.com/2008/12/20/retribution-gospel-choir-bottom-of-the-hill-20080708/

    To be have displayed thumbnails underneath the large preview like here : http://www.sunboil.com/2008/12/20/retribution-gospel-choir-bottom-of-the-hill-20080708/retribution_gospel_choir_20080708_4/

    You can see where the wrong images are being displayed.

  2. cameraphonic
    Posted 7 years ago #

    Apparently my ability to edit or delete this post is not there. I've moved this to the troubleshooting forum in hopes of an answer. Mods please delete this thread.

Topic Closed

This topic has been closed to new replies.

About this Topic