WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] adding a class to image links in posts (2 posts)

  1. manmar
    Member
    Posted 5 months ago #

    Is there a way to add a class to image links in posts? I am trying to open images with a lightbox while using default WP functionality (add media).

    I am tying to go from

    <a href="big-image.jpg">
      <img src="image.jpg">
    </a>

    to

    <a class="lightbox" href="big-image.jpg">
      <img src="image.jpg">
    </a>
  2. manmar
    Member
    Posted 5 months ago #

    With the help from JohanPirlouit's code on Add the title of an image to the image link in gallery I switched to using a rel attribute for the lightbox.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.