In my new theme, I am using this coded trick to display the excerpt on a single post only if I’ve got text inside. Usually if you use
the_excerpt and you don’t have one, it will fake one for you.
This is not something that I wanted to do on the single post page. So I used the following code to check if the excerpt existed.
if ( !empty( $post->post_excerpt ) ) :
Once this action is taken into account, you can factor in what code you want to out put if the
post_excerpt isn’t empty.
if ( !empty( $post->post_excerpt ) ) : the_excerpt(); else : false; endif;
The above code checks if there is an excerpt and print’s it to the screen. If there isn’t an except, it doesn’t do anything.
Random Search Terms
Search Unleased: A custom WordPress plugin
Most all WordPress theme’s use a a simple search form to search your site. But what it you wanted to...
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...
The launch of WordPress.tv
Hey, in case you are unaware, WordPress has launched a new site called WordPress.tv. Check out the full post at...
powered by WassUp
Recent Posts: Fully Net Worth . com
Harry Hains was an Australian actor known to many for playing on American Horror Story. He is also the son of famous actress Jane Badler. Harry Hains net worth before his death is estimated to be $700,000. Harry was born on December 4, 1992, in Melbourne, Australia to Stephen Hains and Jane Badler. He had […]
Gabby Morrison is a young American social media star who is best known for creating videos on the popular and trendy platform TikTok. In a short amount of time, Morrison has been able to garner over 2.1 million followers on the platform where she has received close to 70 million likes for her videos already. […]
Tony Lopez is an American Tik Tok star who is best known for his skills as a dancer and along with his older brother, Ondreaz Lopez completes the synergy of The Lopez Brothers. He has over 2.4 million followers on his profile on Tik Tok where he has received more than 40 million likes so […]