Image caption boxes (Widget vs. Regular)

  • Unknown's avatar

    I adjusted the properties for the widget image on the following page (left hand side – under King’s Landing image)

    https://game-of-thrones-episodes.com/2017/07/19/cersei-plans-for-war/

    But it affected ALL image captions. See the images on the page below. I don’t want these image captions to be changed by what I did above.

    https://game-of-thrones-episodes.com/601-the-red-woman/

    I would like to just be able to create a line of code for all widget images, and not have this affect images elsewhere.

    Can someone please help me. Thanks.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    If you are only wanting to affect the Cersei’s Lust for Power post with the caption CSS, precede the CSS selector with the unique post id CSS class from the opening body HTML tag like this.

    .postid-6242 .wp-caption-text {
     border:1px solid #ddd;
     width:179px;
     text-align:left !important;
     color:#999;
     font-size:14px;
     text-transform:none;
     background-color:#f3f3f3;
     margin-top:0;
     padding:10px 10px 15px
    }

    Each page and each post will have a unique CSS id class in the opening body tag, and you can use that to target styling to just a single page.

  • Unknown's avatar

    no, this is not what I am looking for.

    I will try to explain better. I would like to style the caption for ALL media_image widgets differently than for images which appear elsewhere (non-widgets). Is there a way to style the captions for all widgets one way, and the style for other images to be another way?

    For example, I can make the change for one media_image widget by using the identifier for that widget:

    #media_image-163 .wp-caption-text
    { …
    }

    But it doesn’t work if I try something like

    .media_image .wp-caption-text…

    I rather not have to string all the identifiers if I don’t have too.

    Does this help?

  • Unknown's avatar

    I think I came up with the answer!!!!!

    Please check what I did (bold text below) and advise.

    .widget_media_image .wp-caption-text …

    This changes the caption style for all widget media images, but does not affect the images inside posts.

  • Unknown's avatar

    You got it. Nice job.

  • The topic ‘Image caption boxes (Widget vs. Regular)’ is closed to new replies.