WordPress If Excerpts Else Content

Hi Friends, Going to write down a simple code block of WordPress which will show experts if excerpts exists else show content. So in simple way you can say WordPress If Excerpt else content.

Below is code :

if($post->post_excerpt) {
} else {

So above code can be used and it will show excerpt if excerpt exists else it will show content. I hope this small code will be helpful for someone.

I am PHP FreelancerHire WordPress Developer India and Hire WordPress Programmer. If you have any projects related to WordPress or PHP you can contact me.


  • Tim April 16, 2014 Reply


  • Amy June 27, 2014 Reply

    Thank you! Just what this newbie needed.

Leave a Reply

Your email address will not be published. Required fields are marked *