WordPress Hosting
Free Photos
WordPress Themes

How to Limit Character in The Post Title

<?php function titlelimitchar($title){ if(strlen($title) > 55 && !(is_single()) && !(is_page())){ $title = substr($title,0,55) . ".."; } return $title; } add_filter( 'the_title', 'titlelimitchar' );
Sometimes, You might want to automatically limit the length of post title in the main page. This little wordpress hack will allow you to limit the displayed post title by a defined number of characters on your blogs home page.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.