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

powered by WassUp

Recent Posts: Fully Net Worth . com

City Girls Net Worth: 5 Interesting Facts About The Hip hop duo

City Girls Net Worth: 5 Interesting Facts About The Hip hop duo

City Girls is an American hip hop duo originally from Miami which consists of the rappers Caresha Romeka Brownlee (known as Yung Miami) and Jatavia Shakara Johnson (known as JT). Here are some facts about City Girls including their net worth, career and many more. 1. City Girls has an estimated net worth of $500,000 […]

Tasha K Net Worth: How Rich is the YouTube star Actually?

Tasha K Net Worth: How Rich is the YouTube star Actually?

Tasha K is an American social media personality and pop culture aficionado. She is best known for her YouTube channel ‘unWinewithTashaK’. Tasha K net worth is under review and is not available at the moment. Tasha whose real name is Latasha Transrina Kebe was born on March 10, 1982, in Panama City, Florida but later […]

Roman Kemp Net Worth: How Rich is the Radio host Actually?

Roman Kemp Net Worth: How Rich is the Radio host Actually?

Roman Kemp is an English radio host and presenter. He presents for the national radio network Capital FM and is part of the nineteenth series of I’m a Celebrity…Get Me Out of Here!. As of 2019, Roman Kemp net worth is estimated to be £2 million. Kemp was born on 28 January 1993, in Los […]

%d bloggers like this: