Note: Post updated to reflect line change in WordPress 2.9.
There might be a time when you want to post an entry with double hyphens. However, WordPress wants to show items containing more than one hyphen in a row as a solid line. This is not the desired affect you are after. Thank goodness there is a way to disable this from happening blog wide.
Perhaps you want to display the <!–More–> tag as I did in the post on using it to only show a selected excerpt on your blogs main page. To allow for this types of situations to take place, we will look at the file where the replacement takes place.
The first part of the lines above contain the items that are to be converted. We are interested in the first three items. Remove them and the result will be:
This entry was posted
on Tuesday, June 2nd, 2009 at 1:51 pm and is filed under WordPress.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
WordPress: Double Hyphens Convert?
Note: Post updated to reflect line change in WordPress 2.9.
There might be a time when you want to post an entry with double hyphens. However, WordPress wants to show items containing more than one hyphen in a row as a solid line. This is not the desired affect you are after. Thank goodness there is a way to disable this from happening blog wide.
Perhaps you want to display the <!–More–> tag as I did in the post on using it to only show a selected excerpt on your blogs main page. To allow for this types of situations to take place, we will look at the file where the replacement takes place.
wp-includes/formatting.php
Line 56 – $static_characters = array_merge(array(‘—’, ‘ — ‘, ‘–’, ‘ – ‘, ‘xn--’, ‘…’, ‘“’, ‘\’s', ‘\’\”, ‘ ™’), $cockney);
Line 57 – $static_replacements = array_merge(array(‘—’, ‘ — ‘, ‘–’, ‘ – ‘, ‘xn--’, ‘…’, $opening_quote, ‘’s’, $closing_quote, ‘ ™’), $cockneyreplace);
The first part of the lines above contain the items that are to be converted. We are interested in the first three items. Remove them and the result will be:
$static_characters = array_merge(array(‘xn–’, ‘…’, ‘“’, ‘\’s', ‘\’\”, ‘ ™’), $cockney);
$static_characters = array_merge(array(‘ – ‘, ‘xn--’, ‘…’, ‘“’, ‘\’s', ‘\’\”, ‘ ™’), $cockney);
$static_replacements = array_merge(array(‘ – ‘, ‘xn--’, ‘…’, $opening_quote, ‘’s’, $closing_quote, ‘ ™’), $cockneyreplace);
Save the file and re-upload it to your blog. Now when you enter more than one hyphen in a row in a blog post, they will be display correctly.
Tags: comments, double hyphen
This entry was posted on Tuesday, June 2nd, 2009 at 1:51 pm and is filed under WordPress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.