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.
Anyone in the Los Angeles area? Well the first Sunday of the month is the…
Steam is powerful, hot, and painful. It can move trains, boats, and has driven minds…
I received a Swekey in the mail this week. What's a Swekey you ask? Like…
React js Developer Skills
At the time of writing this post I have Theme Hybrid as my parent theme,…
What do Software as a Service (SaaS) Companies Do?