WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] What happened to the imagelink class? (2 posts)

  1. stevation
    Member
    Posted 7 years ago #

    Just upgraded from 2.0.4 to 2.1.3, and noticed that when I place an image thumbnail in an entry now, WP no longer automatically assigns it with class="imagelink". I had edited my stylesheet to make imagelink do what I wanted in terms of floating and margin around around the thumbnails.

    Why is this no longer the default treatment for images? Is there a simple way to deal with this (getting all new thumbnails to have the same float and margin attributes) that won't create problems next time I upgrade?

  2. stevation
    Member
    Posted 7 years ago #

    OK, I'd still like to know why the new WP doesn't tag images with the imagelink class, but as far as my question on how to deal with the change -- I've figured it out. If you have the same problem, take a look at: this page in the WP Codex. Using those instructions, I changed my theme's CSS stylesheet so all images have the float and padding properties I wanted.

    I added this entry to the stylesheet, duplicating the way I had defined the imagelink class before:

    img {
    float: left;
    padding: 0 10px 10px 0;
    }

    I'm only a tinkerer with CSS, so I have to fiddle with it to get it right. At first, it made a double wide padding on all images that already had been assigned the imagelink class. Then I changed the way imagelink was listed in my css. I previously had it entered like this:

    .imagelink {
    float: left;
    padding: 0 10px 10px 0;
    }

    But changing it to have the "img" prefix in front of the class name made it recognize that when this class is assigned, it overrides the other img settings. Now it looks like this:

    img.imagelink {
    float: left;
    padding: 0 10px 10px 0;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic