Jun
01
2007

Wordpress Changes Double Dashes to Single Dashes: Make It Stop

Wordpress does about 90% of things well and in sane, sane fashion. The other 10% will make you want to gnaw a limb off a cute little kitten.

After putting up with the whole "–" becoming "-" for as long as I could, I finally snapped and tried to look around for a solution. I had fixed this at one point, in a previous version of Wordpress, but for some reason they moved stuff around and the first time I tried to find it I couldn't.

I tried to find something that would take care of it for me, or at least the good word on how to make it go away, but the hits I found on Google weren't very helpful. There's nothing worse than "helpful assholes" who try to tell you that you should just get used to something and why would you ever want to do it That Way to begin with? It seems like every time somebody wants to change something formatting-wise in Wordpress, some of these HAs show up and want to waste your time with trying to convince you instead of just telling you what the hell you need.

So here's what I needed, in case anybody else needs it:


1. Go to wp-includes.

2. Find the formatting.php file

This is, of course, for Wordpress 2+, I believe. If you try to find this and something doesn't fit or something isn't where I say it is, you're probably in a different version. I'm on 2.1.3 right now.

3. Find these two lines:

$static_characters = array_merge(array('—', ' — ', '–', 'xn--', '…', '"', '\'s', '\'\", ' ™'), $cockney);
$static_replacements = array_merge(array('—', ' — ', '–', 'xn--', '…', '"', ''s', '"', ' ™'), $cockneyreplace);

4. Comment them out by placing a // in front of them.

5. Done.

Now, granted, that probably knocks out a lot of other formatting as well, but I'm a lazy bastard and it didn't seem to adversely affect anything I was doing. And if I tried to take out just bits of it, it did funky things. So. There you have it. YMMV.

Written by Widge in: Wordpress | Tags: , , ,

2 Comments »

  • Jones says:

    It's possible that if you remove the
    ' — ', '–',

    bit from line 1, and the
    ' — ', '–',

    from line 2, you might be able to keep the other rules, but you've probably already tried that.

  • Jones: Thanks for the comment. Yeah, I tried pulling out just the bits that looked right but for some reason that set off other changes. No idea why.

RSS feed for comments on this post. TrackBack URL


Leave a Reply

Widge and an ex-duck

This is me.

No, really.

I am a writer, poet, spoken word performer, actor, singer, improviser, content creation and idea machine, freelance iconoclast, and the internet's janitor that dispenses pop culture wisdom to the protagonist of your choice. I have seen too many movies, read too many comic books, and when the zombies finally come, I'm the one you want to call. I sure as hell won't answer the phone, but it's the thought that counts. I advise people on the net, websites and technology, because I know these things instead of having a life or sleeping.

If you like something I've done, donate to the Widge Wants to Kill His Day Job Fund. Or if you'd like to hire me for a job, my rates are terribly reasonable. We thank you.

Powered by WordPress. Theme: TheBuckmaker's Aerodrome.