lucaBiagini.com

Yesterday is but today's memory, tomorrow is today's dream.

Bring down IE 6

Wordpress plugin: the excerpt re-reloaded

UPDATED!

The fantastic plugin The Excerpt Reloaded by Kaf Oseo, my trusted companion in dozens of  Wordpress installation, doesn’t work anymore on WP 2.6, so I have written an alternative version to finish the site I’m working on.

It’s a very small thing, not as complete as The excerpt reloaded, but, at least, it works, and it manages better than its inspirator the allowed tags, adding auto close to avoid pagination and validation errors.

It is based on the plain content of the post (like the content_rss in Kaf’s version) and like its predecessor, allowed tags cannot include <p> paragraphs, simply because I don’t need it on the site I’m currently developing, nor usually on any other. BTW, if somebody is interested, it can be easily fixed (or so I hope).

Parameters

  • words (integer): number of words to display before ending the excerpt. Default is 40.
  • link_text (string): defines the text for the link to the full post. Default is “Keep reading this entry »”. Of course it is displayed only if the selected length is less than the full content. It is displayed in a <p> pararaph with its specific class (more), so it can be easily stylized.
  • allowed_tags (string): defines which HTML tags to accept. Use the format ‘<img>’. For multiple tags, enter as single string: ‘<a><img>’. No tag allowed by default. NEW! Set to ‘all’ to accept all tags.
  • NEW! container (string): defines the container of the excerpt: paragraph, span, div, or none. The container has a specific class=”more” to easily customize its layout through css. If you choose a “div” container, an additional “p” tag inside the div is automatically included. Default is “p”, for no container use “plain”.

Examples

<?php the_excerpt_rereloaded(); ?>
//display the excerpt with default settings.

<?php the_excerpt_rereloaded('80','More','<strong><em>','div'); ?>
//display an excerpt of 80 words
//the link to full post is simply "more"
//allowed tags are strong and em
//the link path is <div class="more"><p><a href="#etc">More</a></p></div>

<?php the_excerpt_rereloaded('80','More','all','plain'); ?>
//display an excerpt of 80 words
//the link to full post is simply "more"
//all tags are accepted
//the link path is included in the excerpt paragraph with no additional container

Download

Click here to view, copy, paste und upload as usual in wp-content/plugins folder. Suggestions are welcome.

Older versions

38 Responses to “Wordpress plugin: the excerpt re-reloaded”

  1. 1 Jaypee said at 9:49 pm on December 4th, 2008

    the excerpt reloaded by Kaf Oseo works fine on my blog running WordPress 2.6.5.

  2. 2 Luca said at 9:57 pm on December 4th, 2008

    Hi Jaypee, thanks for letting me know. I’ve only tested with WP 2.6.2, and it doesn’t work. I’ve seen a couple of people with my same problem, so I decided to publish this small fix. It is simpler to edit and it fix also the problem with the open tags in the excerpt.

  3. 3 Jaypee said at 10:11 pm on December 4th, 2008

    No problem. I also used the excerpt reloaded plugin when I was using WordPress 2.6.2 and didn’t have any problems. Maybe your case and the ones who had problems with it was caused by a conflict with another plugin?

    But nevertheless, its good to see another alternative plugin for displaying excerpts. Keep up the good work! :)

  4. 4 Li-An said at 9:08 am on December 5th, 2008

    ‘Advanced Excerpt” plugin is interesting too :-)

  5. 5 DG said at 1:13 pm on December 5th, 2008

    First off, thanks for the update.

    I’m using Kaf ’s excerpt_reloaded for past 2+ years, and have not faced problems so far.

  6. 6 WordPress Plugins 12/04/08 said at 1:19 pm on December 5th, 2008

    [...] you’re facing any problems with Kaf’s excerpt_reloaded plugin, Luca has updated the plugin to work with WordPress 2.6.x [...]

  7. 7 Luca said at 11:41 am on December 9th, 2008

    Thanks for your interest.

    No, I wasn’t running other plugins, a standard version of WP 2.6 BUT with italian localization. I suspect it could depend on this, I’ll try to test it asap.

  8. 8 Curb Duplicate content with customizable Excerpt plugin for Wordpress - Daily SEO blog said at 4:35 am on December 13th, 2008

    [...] That’s sweet ! Download the plugin here. [...]

  9. 9 WordPress Plugin Releases for 12/04 | HLBV said at 9:19 pm on December 13th, 2008

    [...] The excerpt re-reloaded [...]

  10. 10 Skuzzed.com » WordPress Plugin Releases for 12/04 said at 10:14 pm on December 13th, 2008

    [...] The excerpt re-reloaded [...]

  11. 11 Refresh your dead posts optimizing them for Search Engines with Wordpress 2.7 · SEO Marketing Tips - Tricks, Techniques & Secrets said at 11:46 am on December 15th, 2008

    [...] That’s course ! Download the plugin here. [...]

  12. 12 WordPress Plugin Releases for 12/04 | BlogBroker24-7 said at 1:46 pm on December 16th, 2008

    [...] The excerpt re-reloaded [...]

  13. 13 Monitor Your Website In SERPs | Free SEO Tool · SEO Guide - Tips, Tricks and Secrets said at 5:16 am on December 17th, 2008

    [...] That’s sweet ! Download the plugin here. [...]

  14. 14 SocialMedian is bought by XING · SEO Marketing Tips - Tricks, Techniques & Secrets said at 12:04 pm on December 19th, 2008

    [...] That’s course ! Download the plugin here. [...]

  15. 15 WordPress Plugin Releases for 12/21 | Weblog Tools Collection said at 2:23 pm on December 21st, 2008

    [...] Excerpt Re-reloaded [...]

  16. 16 WordPress Plugin Releases for 12/21 | Wordpress Blog NL said at 10:59 pm on December 21st, 2008

    [...] Excerpt Re-reloaded [...]

  17. 17 WeblogToolsCollection Español » Archivo del Blog » Novedades Plugins de WordPress 21/12 said at 2:55 pm on December 23rd, 2008

    [...] Excerpt Re-reloaded [...]

  18. 18 WordPress Plugin Releases for 12/21 | New Port Me said at 10:02 am on December 26th, 2008

    [...] Excerpt Re-reloaded [...]

  19. 19 paul said at 4:28 pm on January 19th, 2009

    this plugin rocks, its actually one of the most usful i have found. there is just one feature i wish it had. the ability to remove strings or something similar. im using next-gen to place an image within a post (i would rather do it another way but this is the easiest for the noobies who want people to make them a website.

    the except includes the call to the gallery

    “[singlepic=14,320,240,,left]Sales are key to all businesses and how you gain sales will vary depending on your business and the market you work in. Many business do not have a structured sales …”

    is there any way to remove that first call? without placing the image within the custom fields?

  20. 20 Karsten said at 3:02 pm on March 13th, 2009

    I double paul’s request.

    It would be great to have the ability to filter elements in brackets like [galery=x], [audio:filename.mp3] [singlepic=...] etc.

    Even without this, it’s really cool plugin. But with it, it would rock :)

  21. 21 Karsten said at 3:47 pm on March 13th, 2009

    Refering to my previous comment, maybe the could be done by replacing line 52

    $text = strip_tags($post->post_content, $allowed_tags);

    with

    $text = preg_replace(’/\[.*\]/’, ”, strip_tags($post->post_content, $allowed_tags));

    (based on version 0.3 of your plugin)

  22. 22 Luca said at 5:39 pm on March 13th, 2009

    Hi Karsten, thank you for your replies. I’ve been very busy and I’ve forgotten Paul’s request. I try to add this feature, starting from your tip. Stay in tune!

    Ciao
    Luca

  23. 23 Luca said at 9:34 am on March 15th, 2009

    Karsten, I’ve tested your fix and it works fine. I’ve included it in the new version (0.3.1) of the plugin, giving you the credits for it.

  24. 24 baron said at 5:24 pm on March 19th, 2009

    Works great, thank you

  25. 25 Jim seo said at 6:57 am on March 28th, 2009

    works like a charm

  26. 26 WPWeekly Episode 49 - Were You Fooled? said at 4:37 am on April 4th, 2009

    [...] – The Excerpt re-reloaded – This plugin is based off of the Excerpt Reloaded plugin by Kaf Oseo. The highlight of this plugin [...]

  27. 27 lephio said at 7:11 pm on May 1st, 2009

    gran lavoro! proprio quello che cercavo!

    complimenti!

  28. 28 Ronnie said at 11:04 pm on May 11th, 2009

    i’ve uploaded the plugin and activated it but how do i use it? i don’t see it anywhere

    thank you

  29. 29 Luca said at 8:07 am on May 12th, 2009

    Hi Ronnie, just call the_excerpt_rereloaded() within the loop.

    See above for the examples.

  30. 30 Ronnie said at 10:14 am on May 12th, 2009

    i’m not sure what you mean Luca, could you please explain?… i’m very much a noob

    do is work along withthe ‘more’ command when writting posts?

    thanks for your help

  31. 31 Luca said at 10:21 am on May 12th, 2009

    No, you have to edit your theme pages (the ones where you want to show only the abstract), i.e. index.php. Where you find the_content(), replace it with the_excerpt_reloaded() and instead of the whole post content you will show the excerpt.

    Check here for more information about the loop.

  32. 32 Henk said at 7:36 am on May 19th, 2009

    Aah, that should be of course. re_reloaded !! With the extra ‘re’.
    Works great. Thanks Luca (using 2.7.1).
    If you use ‘plain’ in the statement, the “Read more..” statement shows up nicely on the same text line. Good. Offcourse because it then is included in the section of the shorted message.
    Nb. my site is still in test-fase. I am converting to Wordpress. Learning every day.

  33. 33 Ella said at 6:36 am on June 4th, 2009

    Hi…! This rocks. You rock. Thank you for sharing and helping people out. I send you a virtual beer :)

  34. 34 WPTavern Celebrates Thank A Plugin Author Day! said at 11:33 am on June 4th, 2009

    [...] The Excerpt re-reloaded » Luca Biagini (url) This plugin does something more than the built-in excerpt function. It lets choose exceprt length, allowed html tags, the link text to full post and the html container of the excerpt (,, or plain text). [...]

  35. 35 henk said at 7:27 am on June 17th, 2009

    Hi Luca,

    I noticed that for the excerpt length, the words in an image title, under the images “Advanced links”, are included in the count; that is when the image is the first item in the post and I have “a” as allowed tag. The excerpt itself does not show the image, but still it is that number of words shorter than the other excerpts.
    So, now I leave that “Advanced title” empty.
    Still happy with it.

  36. 36 Luca said at 8:49 am on June 17th, 2009

    Hi Henk!

    Thank you for letting me know, I havent noticed yet. I’ll take a look and try to fix it in the next version of my plugin.

    Ciao
    Luca

  37. 37 Francesco Laruina said at 8:32 am on June 25th, 2009

    It works fine on WP 2.8.
    Very good Plugin!
    Thank you!

  38. 38 Wordpress e re-reloaded excerpt | francescolaruina.netsons.org said at 9:00 am on June 25th, 2009

    [...] porre rimedio a questo “problema” ho installato il plugin re-reloaded excerpt con la solita [...]

Leave a Reply