** this plugin is no longer being update. Please feel free to adopt me! **
The Get Better Excerpt plugin works almost identical to the built in get_the_excerpt() and the_excerpt() functions except it returns whole words instead of cutting off the excerpt as the existing function does.
This plugin is maintained by Christopher Ross, http://thisismyurl.com or you can find him on Twitter at http://twitter.com/thisismyurl/
Updates to the plugin will be posted here, to thisismyurl.com
If you would like to donate to help support future development of this tool, please visit thisismyurl.com
- How do I display the results?
Insert the following code into your WordPress theme files:
- General results
Without passing any parameters, the plugin will return ten results or fewer depending on how many posts you have.
- Altering the before and after values
By default the plugin wraps your code in list item (<li>) tags but you can specify how to format the results using the following code:
- Adding a Link
If you’d like to link to the post (remember it’s not live yet) you can do so by calling:
- How many words?
You can specify the number of words returned using the option:
- Skip the excerpt?
If you would like to load the content directly, skipping the entered excerpt:
- Include a trailing character?
By default the plugin includes a … after the excerpt, you can remove it or change it by altering:
- Return a whole sentence
If you would like to return whole sentences rather than words, you can control the number of sentences to return:
- Echo vs. Return
Finally, if you’d like to copy the results into a variable you can return the results as follows:
- uses wp_trim_words()
- Tested for WordPress 3.2
- Optimized code
- removed update functions
Added Sentence options