开发者

How can I make Capital letter ( upper-case ) permalinks?

How can I make a link like this?

http://www.lifecellskin.us/Dev/About

the "Using_Permalinks" part, A is Capital letters. But WP automatically convert upper case to lower case.

htt开发者_StackOverflow社区p://www.lifecellskin.us/Dev/about

I'm trying to convert an old site that made by only html to a WP platform site. Some links to the site look like this:

http://www.lifecellskin.us/About

The site is already indexed by SEO. so I don't want to lose SE rankings.

Thanks for reading this, and hope somebody will be able to shed some light on it...


I am giving the answer of my own question because I figure out the soloution.

Here is a function given below add this function to `wp-includes->formating.php'

      function sanitize_title_with_dashes($title) {
          $title = strip_tags($title);
           // Preserve escaped octets.
           $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
          // Remove percent signs that are not part of an octet.
         $title = str_replace('%', '', $title);
         // Restore octets.
          $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);

         $title = remove_accents($title);
            if (seems_utf8($title)) {
             //if (function_exists('mb_strtolower')) {
           //    $title = mb_strtolower($title, 'UTF-8');
    //}
        $title = utf8_uri_encode($title, 200);
}

//$title = strtolower($title);
$title = preg_replace('/&.+?;/', '', $title); // kill entities
$title = str_replace('.', '-', $title);
// Keep upper-case chars too!
$title = preg_replace('/[^%a-zA-Z0-9 _-]/', '', $title);
$title = preg_replace('/\s+/', '-', $title);
$title = preg_replace('|-+|', '-', $title);
$title = trim($title, '-');

return $title;

}

This function is already exist in formatting.php comment out that and add the above function. Thanks


File : wp-includes/formatting.php

Line 826

$title = mb_strtolower($title, 'UTF-8');

Comment out that line

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜