WordPress.org

Ready to get started?Download WordPress

Forums

Post From Site
Add class and rel to image links (2 posts)

  1. Vergilius
    Member
    Posted 2 years ago #

    Hi, i'm looking for some solution that will add class and rel attribute to all image links.

    Something like this, but compatible with Post From Site plugin.

    http://wordpress.org/extend/plugins/post-from-site/

  2. Vergilius
    Member
    Posted 2 years ago #

    Temporary i'm using javascript:

    $(document).ready(function() {
        $(".gallery a").addClass("photo");
        $(".gallery a").each(function() {
          this.rel += 'gal';
        });
    });

    This snippet adds class="photo" and rel="gal" for all links inside gallery div.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic