Forums

[resolved] Gallery link back to parent post (3 posts)

  1. geekjon
    Member
    Posted 1 year ago #

    Here's what is going on. When I have a post with multiple thumbnails linking to the "medium-sized" image posts, there is no link back to the parent post. If someone gets to this page via a search engine, then they have no way of knowing that there is more related content.

    Example:
    Parent post
    http://geek.thinkunique.org/2008/07/18/watchmen-trailer-1/
    Sub post
    http://geek.thinkunique.org/2008/07/18/watchmen-trailer-1/watchmen1/

    Let me know if there is a way to add a link back to the parent post. Thanks in advance.

  2. omgitztrey
    Member
    Posted 1 year ago #

    If you found out anything please let me know.

  3. geekjon
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic