ENTRY
381

CoolExcerpt Wordpress Plugin

CoolExcerpt Wordpress Plugin
Sunday, April 22, 2007
/ Blogging, Programming, Wordpress

A few months ago, I wrote a flickr plugin for wordpress that integrated with a few different image galleries including Lightbox and Greybox. As last count, 126 different blogs were using the crossroads plugin to show their flickr images in their posts.

While updating my blog theme last night, I realized one of the current problems I have with most of the themes I downloaded. Typically, a theme will present the full content of a few blog entries on the main page. A few of the “cooler” themes I’ve seen only show one post on the main page, which is sort of a neat idea if you don’t write very often, but on blogs with multiple entries per day, it becomes easy for readers to miss posts.

A more common approach I’ve seen on blogs is to show the latest entry in full and also show a few other entries in brief form (what Wordpress calls an excerpt). One catch with the excerpt is that it automatically strips out all the HTML code to ensure that the text is brief. Unfortunately for me, since many of my blog entries are photocentric, I lose some of the context about what the blog post is about. For example, if you as a reader were to read the text of an excerpt for a photocentric blog entry, you may not think it was interesting enough to dig deeper, and miss seeing a photo or two. The advantage of excerpts is that you can show more content on your main page without burdening the reader by having to read every entry in full as they progress down your main page.

So, today while sitting at home debating how I was going to fix my door, I decided to write something to address that issue. What I came up with is a new Wordpress plugin which I’m tentatively calling “CoolExcerpt.” This plugin scans each excerpt entry and determines whether or not it contains any image or video content and indicates that by displaying related icons underneath the excerpt. In addition, I’ve added some Ajax functionality to automatically show the full content via an excerpt link without having to reload the whole page from scratch.

If anyone wants to test it out and give me some feedback, feel free to download the plugin here. It requires the scripaculous effects library to be loaded before hand, so you must have a theme that uses the library or download the Wordpress scriptaculous plugin.

After activating the plugin, replace each instance of the_content() with ds_the_content() and the_excerpt() with ds_the_excerpt() in your theme files.

9 comments
the duane storey
Posted on Monday, April 23rd, 2007 at 9:53 am

[...] I created a new plugin for wordpress that scans excerpt entries and adds photo and video icons for related posts. You can read more about it here. [...]

Jonathan Lumb
Posted on Monday, April 23rd, 2007 at 10:02 am

Hi Duane
Your new plugin is very impressive, I’ve tested it out on your frontpage!
This one isn’t so useful to me on my blog as I’m happy with my setup now but its nice to see that when you are developing solutions for your own site, you realise that they could be useful to others and share the wealth!
Nice work.
Jono

Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 05/01
Posted on Tuesday, May 1st, 2007 at 2:38 pm

[...] Cool Excerpt scans all post entries for audio and video content (and associated tags), displaying audio or video icons under each excerpt. Also supports Ajax transitions between excerpt and posts inline. [...]

WeblogToolsCollection Español » Blog Archive » Plugins de WordPress publicados 1/5
Posted on Sunday, May 6th, 2007 at 9:37 am

[...] Cool Excerpt escanea todas las entradas buscando contenido de audio y video (y etiquetas asociadas), y despliega íconos de audio y video debajo de cada extracto. También soportaq trancisiones de AJAX entre extractos y entradas en linea. [...]

Ananth
Posted on Wednesday, May 23rd, 2007 at 3:26 pm

This is what i have been looking for…. cool and thanks… i’ll try it soon.

oriolrius lifestream » the duane storey
Posted on Wednesday, May 30th, 2007 at 9:25 am

[...] the duane storey [...]

» 50 Tools to Use or Embed Videos in Your WordPress Blog Social Networking Articles Blog
Posted on Friday, November 2nd, 2007 at 8:03 pm

[...] CoolExcerpt Plugin This plugin scans each excerpt entry and determines whether or not it contains any image or video content and indicates that by displaying related icons underneath the excerpt. In addition, I’ve added some Ajax functionality to automatically show the full content via an excerpt link without having to reload the whole page from scratch. [...]

Clemens
Posted on Monday, February 11th, 2008 at 6:00 am

The link to download the file is not working anymore. Could you please re-post this link?

the_excerpt() melhorado?
Posted on Monday, March 24th, 2008 at 9:47 am

[...] apenas para testes. Fechando parênteses. O assunto que me levou a escrever esta entrada é um plugin que modifica a apresentação do extracto dos posts colocando o icon de uma máquina fotográfica [...]

Back to the Top

google.load("language", "1"); var curstate = 0; var hasloaded = 0; function bnc_show_translated() { if (hasloaded == 0) { bnc_lang_callback(); hasloaded = 1; } for (i = 0; i < 10; i++) { var elem = $("bnc_original_" + i); if (elem) { if (curstate) { elem.show(); } else { elem.hide(); } } } for (i = 0; i < 10; i++) { var elem = $("bnc_trans_" + i); if (elem) { if (curstate) { elem.hide(); } else { elem.show(); } } } if (curstate) { $("bnc_trans_state1").show(); $("bnc_trans_state2").hide(); curstate = 0; } else { $("bnc_trans_state1").hide(); $("bnc_trans_state2").show(); curstate = 1; } } function bnc_detect_div(div_id) { var text = document.getElementById(div_id); if (text) { text = text.innerHTML; if (text.length > 0) { google.language.detect(text, function(result) { if (!result.error) { if (result.language != "en") { if (result.confidence > 0.25) { $("bnc_translating").show(); bnc_xlate_div(result.language, div_id, "en"); } } } } ); } } } function bnc_xlate_div(src_lang,div_id,o_lang) { var text = document.getElementById(div_id); if (text) { text = text.innerHTML; google.language.translate(text, src_lang, o_lang, function(result) { var translated = document.getElementById(div_id); if (result.translation) { translated.innerHTML = result.translation; } }); } } function bnc_lang_callback() { bnc_xlate_div("en", "bnc_lang_i_0_381", "en"); bnc_xlate_div("en", "bnc_lang_i_1_381", "en"); bnc_xlate_div("en", "bnc_lang_i_2_381", "en"); bnc_xlate_div("en", "bnc_lang_i_3_381", "en"); bnc_xlate_div("en", "bnc_lang_i_4_381", "en"); bnc_xlate_div("en", "bnc_lang_i_5_381", "en"); bnc_xlate_div("en", "bnc_lang_i_6_381", "en"); bnc_xlate_div("en", "bnc_lang_i_7_381", "en"); bnc_xlate_div("en", "bnc_lang_i_8_381", "en"); bnc_xlate_div("en", "bnc_lang_i_9_381", "en"); bnc_xlate_div("en", "bnc_lang_i_10_381", "en"); bnc_xlate_div("en", "bnc_lang_i_11_381", "en"); bnc_xlate_div("en", "bnc_lang_i_12_381", "en"); bnc_xlate_div("en", "bnc_lang_a_0_0", "en"); bnc_xlate_div("en", "bnc_lang_a_1_0", "en"); bnc_xlate_div("en", "bnc_lang_a_2_0", "en"); bnc_xlate_div("en", "bnc_lang_a_3_0", "en"); bnc_xlate_div("en", "bnc_lang_a_4_0", "en"); bnc_xlate_div("en", "bnc_lang_a_5_0", "en"); bnc_xlate_div("en", "bnc_lang_a_6_0", "en"); } function bnc_startup() { bnc_xlate_div("en", "bnc_translate_info", "en"); bnc_xlate_div("en", "bnc_translate_info2", "en"); bnc_detect_div("bnc_lang_i_0_381");bnc_detect_div("bnc_lang_i_1_381");bnc_detect_div("bnc_lang_i_2_381");bnc_detect_div("bnc_lang_i_3_381");bnc_detect_div("bnc_lang_i_4_381");bnc_detect_div("bnc_lang_i_5_381");bnc_detect_div("bnc_lang_i_6_381");bnc_detect_div("bnc_lang_i_7_381");bnc_detect_div("bnc_lang_i_8_381");bnc_detect_div("bnc_lang_i_9_381");bnc_detect_div("bnc_lang_i_10_381");bnc_detect_div("bnc_lang_i_11_381");bnc_detect_div("bnc_lang_i_12_381"); } google.setOnLoadCallback(bnc_startup);