Quick fix for the annoying caption hyphen in Twentyeleven theme

  • Author
    Posts
  • #1032924

    Hi,
    Reading through the forums i did not see an easy fix given for removing the hyphen that appears before the text in picture captions.
    Here’s what I did that removed it:

    In style.css look for:
    }
    .wp-caption .wp-caption-text:before {
    color: #666;
    content:’ \2014′;
    font-size: 14px;
    font-style: normal;
    font-weight: bold;
    margin-right: 5px;
    position: absolute;
    left: 0px;
    top: 7px;

    Simply remove the \2014 (special character code) from the content line. They haven’t shown up since.
    Please be careful when modifying anything in WordPress so you don’t F-up your blog, obviously i have just given my fix and cannot be held responsible…blah, blah
    Happy Blogging!

    #1033078

    1tess
    Moderator Emeritus

    Are you referring to a wordpress.com site or a wp.ORG site?

    Also, is there a significant difference with this “dashed caption” problem between the CSS of wp.COM and wp.ORG?

    #1033080

    Ooooh sorry for any confusion, I have all my blogs on my own hosting so I guess it would be the ‘standalone’ WordPress that you install onto your server.
    Sorry if I posted in the totally wrong place, I came across this forum googling for the hyphen fix.

    #1033082

    1tess
    Moderator Emeritus

    Thank you for answering.

    I don’t know much about CSS so I don’t know if your solution will work with our wp.com version of the theme. So if another volunteer knows, please jump in to say whether this is useful here or not.

    #1033084

    justpi
    Member

    First, if you only remove the special character code, the caption will remain in its original positioning, which doesn’t make sense without the hyphen: you also need to change the horizontal positioning of the caption text (if I hid the stupid hyphen I’d make the text centered).
    Second, things don’t work that way on wordpress.com: you don’t modify the original stylesheet, you add your changes in the CSS editor. To remove the hyphen and center the caption, you’d add this:

    .wp-caption .wp-caption-text:before {
        display:none;
    }
    .wp-caption .wp-caption-text {
        text-align:center;
        padding:5px 7px 0;
    }

    #1033098

    1tess
    Moderator Emeritus

    ~~thanks panos

    #1033119

    Yea, I had to change the horizontal spacing too. Thanks for the input everyone.

The topic ‘Quick fix for the annoying caption hyphen in Twentyeleven theme’ is closed to new replies.