• Looking for a way to modify the “Continue reading” link on attacment pages. By default this link is added to the Caption, and (oddly?) links to the attachment page itself, the same page the reader is looking at.

    It would make sense to me to have the link text added after the Description instead and link to the parent post, where the image is being used.

    The template file for image attachments is image.php, and it seems to me that lines 50-54 are serving the caption, like so:

    <?php if ( has_excerpt() ) : ?>
        <div class="entry-caption">
            <?php the_excerpt(); ?>
          </div><!-- .entry-caption -->
    <?php endif; ?>

    But I can’t seem to figure out where the “Continue reading” text/link comes from or how to remove it, and add to the description. Would greatly appreciate advice, including links to articles that might help me better understand the underlying structures.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi –

    Thanks for writing to us.

    1. the Continue Reading link shouldn’t be there, and we’ll look into that.

    2. Manually add a link from the Description field if you would like to link back to the page that the image is attached to, but that’s not a change we’d make in the theme now because it would cause this link to suddenly appear for other people, and they may not want it.

    Hope that helps!

    Thread Starter thorirv

    (@thorirv)

    Thanks @lizkarkoski

    1. Yea, I couldn’t see the logic for adding a ReadMore link to the caption. This explains..
    2. I understand. The plan was to add it to a child theme file.

    Thanks again!

    • This reply was modified 6 years, 3 months ago by thorirv.

    No problem. Take care ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“Continue reading” link on image.php’ is closed to new replies.