Username: Save?
Password:
Home Forum Links Search Members Login Register*
    News: Click Here to Join TechnoWorldInc Community on Orkut.
Search Site
Recent Updates
[Today at 11:08:57 AM]

[Today at 11:05:39 AM]

[Today at 10:20:30 AM]

[Today at 09:25:53 AM]

[Today at 09:10:23 AM]

[Today at 09:02:58 AM]

[Today at 07:31:44 AM]

[Today at 06:17:52 AM]

[Today at 06:06:49 AM]

[Today at 05:50:50 AM]

[Today at 05:37:04 AM]

[Today at 05:34:22 AM]

[Today at 05:20:21 AM]
Subscriptions

Enter your E-mail :

Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Programming Zone » PHP
 Make Wordpress Stop Replacing Double Dash with Em-dash
Pages: [1]   Go Down
  Print  
Author Topic: Make Wordpress Stop Replacing Double Dash with Em-dash  (Read 4318 times)
Khushi
Global Moderator
Adv. Member
*****



Karma: 4
Offline Offline

Posts: 329

Hello!!


View Profile
Make Wordpress Stop Replacing Double Dash with Em-dash
« Posted: January 02, 2007, 01:10:59 PM »

Wordpress by default replaces the double dash (--) with an em-dash character. If you are showing code or programming examples this will cause your visitors unnecessary confusion. This recipe shows the simple way to turn that behavior off.

This problem is occurring because Wordpress automatically runs a bunch of filters on your content before displaying it out to the browser. These filters include the smiley face replacement and others to try and clean up the content and make it more presentable to users. We will leave the rest of the filters alone.

Start by using either your ftp, ssh, or other client to open up the SITE_ROOT/wp-includes/functions-formatting.php file in a text editor and find these two lines:

Code:
$curl = str_replace(? -- ?, ? ? ?, $curl);
$curl = str_replace(?--?, ???, $curl);

You can comment out these lines by putting the php // comment characters before them both, or you could simply delete the lines. When you are done, it should look like this:

Code:
//$curl = str_replace(? -- ?, ? ? ?, $curl);
//$curl = str_replace(?--?, ???, $curl);

Now you will be able to see the double dash character in your blog posts, and no more comments from upset visitors saying that your examples aren't working. =)
Logged

TechnO wOrld InC - The Best Technical Encyclopedia Online!
Pages: [1]   Go Up
  Print  
 
Jump to:  


Add to Google Subscribe in NewsGator Online Add to netvibes Subscribe in Bloglines Add to Webwag
Copyright © 2006-2012 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.109 seconds with 24 queries.