Created
January 31, 2023 00:12
-
-
Save jackfearing/ba215927b56805335f5ef55461f7baa8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Quick Tip! What happens when your post title does not fit on one line? It wraps to the second line. What if it’s only one word? And what if that word is “it” or some other shorty? Your title won’t look too nice, eh? Here’s a solution, somewhere inside the loop: | |
*/ | |
$title = the_title( '<h2>', '</h2>', false ); | |
if ( strlen( $title ) > 0 ) | |
echo substr_replace( $title, ' ', strrpos( $title, ' ' ), 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment