• I would like to be able to apply a class to each image I put in my posts. I can do it manually of course, after the image code is in the editor, but this site is going to be used by people with little or no experience in web, so it would be better to just have an option to type in the class when you put the image in the post.

    Could you write a function that either replaces for example the link option with a class option? Or maybe even add another option to type in a classname?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I would like to be able to apply a class to each image I put in my posts

    – Are the default classes that WordPress provides not adequate enough? Are you trying to target CSS styles to post images?

    – I took a quick look and couldn’t find anywhere to hook into the default image classes WordPress uses, though I guess you could filter the post content before it’s saved to the database.

    Or maybe even add another option to type in a classname?

    – When using the visual editor if you hover over an image already in the post editor there is an image editor icon that appears. On the modal window that appears after clicking the icon there is an “Advanced Editor” that lets you add additional class names.

    Thread Starter devotee

    (@devotee)

    I would like to apply different css-settings to different images, so I have the power to float them around and use different padding and margin if I like.

    I did find a code witch adds the image dimensions as a class name, pretty nifty and does the trick for me, since I want to be able to style every image with the same dimensions the same way anyway.

    Thanks for telling me about that beeing able to add a class in the advanced editor, I′ve never even seen that! That is great, although in this case I think its just as cumbersome for my clients to do that as to add the class by just typing it in. Anyway, I solved my problem.

    Thanks for helping

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Replace image attribute with a class instead? (image uploader)’ is closed to new replies.