Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Welcome to the TechnoWorldInc! Community!
Recent Updates
[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 24, 2024, 11:48:22 AM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[February 14, 2024, 02:00:39 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
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 18193 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 03, 2007, 12:40:59 AM »


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

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.086 seconds with 24 queries.