Update June 6, 2007: There is a problem with closing HTML tags in Kaf’s Excerpt Reloaded Plugin. This means that if you define <ul> as one of the HTML tags you want to preserve in your excerpts, you may end up with a page of excerpts that is one big list, since the closing </ul> may be ommitted. Rob created a mod of the Excerpt Reloaded plugin which preserves closing tags, but after testing it out on this site, I found that the first version still had some problems with formatting. Rob went and fixed his plugin, which I subsequently activated on this site, and now my excerpts look normal! Bless his soul. Read my full review of this new mod.
Update June 5, 2007: Rob from Rob’s Notebook posted a comment, which you can see below, about his mod of the Excerpt Reloaded plugin. There is a problem with the original plugin where very often the closing paragraph tag </p>
is missing. Rob says that his plugin fixes that. I have installed his plugin on this site, but haven’t seen any noticeable improvements since the biggest problem that I’ve found with the original plugin, and which still exists with his, is that almost none of the tags are closed. Blockquote, ul, li are all left open, and therefore affect the entire page that follows any excerpts with any of these tags. You can see what I mean by clicking on the archive links in the sidebar.
One of my clients asked me to make sure that links are displayed in excerpts. I don’t know what the advantage of not having links in excerpts is, and why WordPress defaults to removing these links.
After searching extensively on the web, it seems that the only solution to this problem is The Excerpt Reloaded plugin at guffszub.net. This plugin customizes which HTML tags to allow, length of the excerpt (in words), “more…” link, and filtering type.
At first I couldn’t get it to work, but I figured out what the problems were, and I want to share them in case others have trouble too:
- I didn’t download the zip file, and was using the display page instead. No matter what I did, I kept getting an error message when I activated the plugin. It turns out that the display page has a space at the end of the code after the closing php tags. Once I deleted the space, the plugin began to work.
- Guff says to put the function in The Loop. Maybe it’s because I was tired, but I understood that to mean that it just needed to appear anywhere within The Loop to work. What it actually means is that the function needs to appear wherever it is that you want the excerpt text to appear. So for example, if you want the excerpt to appear instead of the content, you need to replace
<?php the_content();?>
with<?php the_excerpt_reloaded(); ?>.
- Make sure you put the tag in all the template files that are relevant. Some examples of files that you may want or need to modify are index.php, home.php, archive.php, search.php, and category.php. (Don’t worry if you can’t find some of these files in your theme – some of these files are optional for themes.)
The Excerpt Reloaded is now activated on this site.
Rob’s mod of the Excerpt Reloaded Plugin is now activated on this site.
Kaf’s Original Excerpt Reloaded>>
Rob’s mod of the Excerpt Reloaded Plugin>>
Pingback: The Excerpt Reloaded: Another Reason Why Tags Aren’t Getting Closed()