• When you make a new post and upload/attach an image, WP makes the following link:

    <a href="http://www.example.com/link/to/attachment/page/" rel="attachment wp-att-###"><img ... ></a>

    But I want to modify this so that the link it makes isL

    <a href="http://www.example.com/linktoactualimage.jpg" rel="custom-rel attachment wp-att-###"><img ...></a>

    The changes being that I want the link to link to the actual picture, and I want to add a custom rel tag. How can I change this? I’ve looked in the media.php and upload.php files but I can’t seem to find anything.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I too would like to be able to do this. Only I want to use my image descriptions as a rel tag in the link, or as a longdesc tag in the image for lightbox purposes. I know that lines 103-115 of the wp-admin/includes/media.php change the links that are put in to the editor, but I don’t want to directly edit core code. I am too unfamiliar with the add_filter tag to know how to modify core functions. Any help would be greatly appreciated.

    Thread Starter a-fluid

    (@a-fluid)

    Are you sure about that? I just checked those lines in wp-admin/includes/media.php and I don’t see anything that does what you say it does.

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

The topic ‘Modify image post/attachment link and rel tags’ is closed to new replies.