Simple WordPress PlugIn to Replace Excerpt With Full Post

Content As Excerpt Checkbox

I recently posted my lame joke video mashing together The Andy Griffith with Star Wars. In posting it, the excerpt for the post was showing on my site’s homepage and one had to click through to watch the video. There was nothing much to the text of the post – the only thing of note was the video itself (and that is up for debate). Really I just wanted to show the entire post so the video was playable without the extra click. Instead of an excerpt, I wanted the entire post’s content to be displayed. I looked for an existing plug-in to handle this but did not find one. Being such a simple task, I decided to write my own plug-in. It is available for download and viewing on GitHub.

Like I said, the plug-in is very simple. I added a checkbox in the Publish meta box for posts to “Use Content For Excerpt.”

Content As Excerpt Checkbox

I then added a filter action for get_the_excerpt. This function simply looks for the status of the “Use Content For Excerpt” checkbox for the post and, if it is checked, I simply return the value of $post->post_content run through the the_content filter.

Leave a comment

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