I recently started getting back into looking around at WordPress coding, as I finally upgraded after quite a while and noted the new available features (including tagging, which I know has been there for quite a while now), which got me started thinking about designing the site a little. In doing so, I was again wanting to do some more interesting stuff with the entry “excerpts” that you can use on index pages. In my search I came across a nice simple plugin called Advanced Excerpt.
The problem with the out of the box excerpt in WordPress mainly is that it is fairly restrictive. Without digging in to the code, you can’t change the number of words displayed, and I believe by default it still strips any extra html markup (i.e. bye-bye flickr thumbnails). However, Advanced Excerpt allows you to easily designate how many words to use, allows you to use html markup (and choose accepted tags), and allows you to specify a custom ellipses for the end of the blurb (which is I think by default […], can’t recall now). Go download Advanced Excerpt.
However, Advanced Excerpt is still missing something that I really wanted. You still can’t click the […] at the end of the article to “read more.” I jumped into the plugin code and fixed that in the code you see below. I have not included the entire plugin code, so what you need to do is copy the code here and replace the function called “filter” in the original code; this is the guts of the text replacement. Basically, all I have done is wrapped the ellipses with a permalink to the article, which is the same as the link attached to the excerpt article title. I also added in a title for the link as well. Enjoy!