Connect with us

Tips & Tricks

Limit the characters that display on the_title

Ever wanted to display the title of a post somewhere but limit the amount of characters that are shown? For instance, this post has a very long title, and if I were to use <?php echo the_title() ?> it would show as follows: Limit the characters that display on the_title.

That may not fit well on one line in lets say a widget or small width div. So here is a neat trick you can use:

<?php $title = the_title('','',FALSE); echo substr($title, 0, 11); ?>

Pretty simple huh, just note the bold numbers, in this case 11 character would output like this: Limit the c.

Thanks to Tattershall Way for this snippet.

Random Search Terms

Title

Top Articles

Top Searches

powered by WassUp

Recent Posts: Fully Net Worth . com

Pratt Daddy Crystals Net Worth – & more crazy stats

Pratt Daddy Crystals Net Worth – & more crazy stats

Pratt Daddy Crystals Net Worth. How much is the pratt daddy crystals company worth? Let us go through what we know and what we don’t know about this company, seems like a lot of people are interested in knowing exactly how many sales does the pratt daddy crystals company make or what pratt daddy is […]

Court Westcott Net Worth- How Rich is Kameron Westcott’s husband?

Court Westcott Net Worth- How Rich is Kameron Westcott’s husband?

Court Westcott is a venture capitalist who is a managing partner of the company named Westcott LLC which was founded by his father Carl Westcott with the company being a personal investment platform for entrepreneurship. The Westcott family is known to be one of the prestigious families from Dallas. As of 2019, Court Westcott net […]

Lil Keed Net Worth: How Rich is the Rapper Actually?

Lil Keed Net Worth: How Rich is the Rapper Actually?

Raqhid Jevon Render is an American rapper and songwriter. He is best known for his songs such as “Nameless” and has risen the ranks from his neighborhood in Atlanta into an emerging star in the world of rap. Currently, Lil Keed has a contract with Young Thug’s YSL Records and 300 Entertainment. As of 2019, […]

%d bloggers like this: