Viewing 3 replies - 1 through 3 (of 3 total)
  • I suppose the images are used within the loop?
    And those from the main page are located in the index.php ?

    If that’s the case you can add a link by writing the following on the appropriate template page just beneath the image code, within the <p>-element:

    <p class="wp-caption-text">
    <a href="<?php the_permalink()?>"><?php the_title()?></a>
    </p>

    Of course you can use this snippet on every template page you want the caption to appear as a link. Hope that works for you. I don’t know how big your knowledge in wordpress is. Just ask for further help 🙂

    Thread Starter annalouis

    (@annalouis)

    hello Many thanks for your response. I am a newbie to wp, so I don’t have great technical know how!

    I have lots of images on most pages where I want to link the captions to other pages. The images I have inserted are not relating to any posts, just other pages. The code that you kindly provided, I dont see where I can paste on the actual HTML page as there is no <p element.
    However when I looked at the loop page, do I enter it somewhere in here?
    Many thanks

    [code moderated - please use the pastebin - see forum guidelines]

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add links to image captions’ is closed to new replies.