• I would like to have two different font styles within the same caption.

    For instance, a person’s name in one size font directly below their photo and their title in a smaller font below their name.

    Suggestions, please, on how to do this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Please provide a link to an example. We need to look at the code and style sheets on your particular site in order to be helpful.

    In my tests, I can see that a HTML tag can be added to a caption. So just wrap the name in a tag that you can target via CSS.

    Thread Starter ruauu2

    (@ruauu2)

    Here is a page where I would want to have two different font styles:

    https://mvuuf.org/wp/welcome/ministerial-search-committee-profiles/

    You wrote: “…wrap the name in a tag that you can target via CSS.”

    To do that, would I add the class selector and declaration to Appearance > Theme options > Custom CSS and then add <p class=”whatever”> to the Text tab of Edit Page?

    Or would that be <span class=”whatever”>?

    Yes, you are getting it.

    For example:
    In your caption you have this:
    Alice Diebel <br> Search Committee Chair

    Change it to:
    <span>Alice Diebel</span><br />Search Committee Chair

    Then in your CSS:

    .wp-caption span {
      font-size: 14px;
      font-weight: bold;
    }
    Thread Starter ruauu2

    (@ruauu2)

    Thank you, totaltec,

    It looks like that should do it – it’ll be a few days before I’ll have the chance to try it.

    After I try it and if I don’t have any issues with it, I’ll come back here and mark it resolved.

    I appreciate your help!

    Thread Starter ruauu2

    (@ruauu2)

    I just went ahead and tried it.

    It wouldn’t work without !important.

    Also, I used em instead of px – is that OK?

    Thanks for reporting back! em is just fine.

    You needed the !important modifier probably because your theme has a lot of classes defined directly on the page, rather than in an attached style sheet. Glad you figured that out!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Two different font styles within same caption?’ is closed to new replies.