WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Link to Post Parent from Attachment Page (1 post)

  1. cameraphonic
    Member
    Posted 5 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.

Topic Closed

This topic has been closed to new replies.

About this Topic