Automatically Title Case WordPress Post Title

I have a web site that was previously build with php programming, just a simple website  but then I decided to ported it to be a WordPress base website.
The moving process it self just need a few minutes using my custom wordpress db importer plugin, the longer process is tweaking the WordPress blog it self.
One of the problem that I face after converting the website into WordPress base website is about the post title. In the previous database, I don’t use a proper title capitalization in the article, all title case is in lowercase :wink:. Lowercase in the title is not a problem before because with just a simple ucwords function in the php code or using simple text-transform style in the css, these lowercases post title will be transformed nicely into title case post title.
But that’s not the case in WordPress blog.
Simple way to force WordPress to title casing or changing the first letter of each word in the post title is using this following code:
function pk_title($content)
$content=ucwords($content);
return $content;add_filter(‘wp_title’, ‘pk_title’);
add_filter(‘the_title’, ‘pk_title’);
All we need to do is just copy and paste the code above into file Functions.php of our WordPress theme and all set. The problem is, this method will change the first letter of all word found in the post title, even for small word like a, an, and, of etc.
After quick search in WordPress plugin database, fortunately, they already had a nice plugin called Title Case and Title Case Capitalization plugins. Once activated, both plugins will automatically filter post titles as they are output and put them in proper Title Case, including the un-capitalizing first letter of small word.
Which one do you wanna use?
Possibly Related Software
wordpress SEO toolkit pro
If you want to view an online demo, please click on "products" above. *Note, you also get the full source code for this product* Get more search engine traffic to your wordpress blog! what you get in this tookit: includes 1 yea...
Blue Sea Wordpress Theme
Theme Name: Blue Sea Theme Theme URI: http://demos.godsw.cn Description: Blue Sea WordPress theme designed by zqy. Version: 1.0 Author: zqy Author URI: http://demos.godsw.cn/ This theme is released under Creative Commons Attribution 2....
Blue Sea Wordpress Theme
Theme Name: Blue Sea Theme Theme URI: http://demos.godsw.cn Description: Blue Sea WordPress theme designed by zqy. Version: 1.0 Author: zqy Author URI: http://demos.godsw.cn/ This theme is released under Creative Commons Attribution 2....
This entry tagged with WordPress, WordPress Plugins and is filed under Blog, Tips and Tricks.




Submit your comment