• Resolved pipspeak

    (@pipspeak)


    What would the best way be to add an optional class to the “add featured image” process? I want the ability to change the style of some featured images but not others (to be decided when the image is added to a post), so simply assigning a style to an existing featured image class is not an option and nor is assigning a style to images on specific pages.

    I assume a new meta field is required, but I’m curious if there’s a more obvious way to do this. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can target the data in the Alt Text area using CSS like so:

    [alt="styledimage"] {
      border:1px solid #000;
    }

    So you could put the text styledimage in the Alt Text area for the featured image the same as you would put the class you want.

    Thread Starter pipspeak

    (@pipspeak)

    Awesome idea. I always forget how many weird and wonderful css selectors there are

    Great! Could you please mark this topic as [resolved] ? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add a new class to featured images’ is closed to new replies.