WordPress.org

Ready to get started?Download WordPress

Forums

Automatically add "rel" attribute to attachment links? (1 post)

  1. Joe Hall
    Member
    Posted 7 years ago #

    I want to edit the code that inserts attachments into a post to include a "rel" attribute to image thumbnail links. In other words. I want my image thumbnail links to automatically include a "rel" attribute. So that...

    <a href='http://www.example.com/wp-content/uploads/2007/06/example.JPG' title='example.JPG'><img src='http://www.example.com/wp-content/uploads/2007/06/example.thumbnail.JPG' alt='example.JPG' /></a>

    Looks like:

    <a rel='example' href='http://www.example.com/wp-content/uploads/2007/06/example.JPG' title='example.JPG'><img src='http://www.example.com/wp-content/uploads/2007/06/example.thumbnail.JPG' alt='example.JPG' /></a>

    I want the rel attribute to be added to the code automatically so that I don't have to go back and edit the html everytime I embed a picture. Anyone have any idea how this can be done?

Topic Closed

This topic has been closed to new replies.

About this Topic