Viewing 2 replies - 1 through 2 (of 2 total)
  • If you found out anything please let me know.

    Thread Starter geekjon

    (@geekjon)

    What I did was create a template called image.php which is basically the same as my index.php but where the entry would go I put the following code:

    <p>This post belongs to <strong><a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo get_the_title($post->post_parent); ?></a></strong></p>
    				<p style="text-align:center" class="attachment"><a title="<?php the_title(); ?>" href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php echo wp_get_attachment_image( $post->ID, 'medium' ); ?></a></p>

    This puts a link back to the parent post and below that is the medium-sized image.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Gallery link back to parent post’ is closed to new replies.