Oftentimes in working with WordPress I find that I don’t want things to be as automatic as they are by default. Or, more precisely, I want things to be automatic in a very custom way to fit my theme and design.
Excerpts have long annoyed me, but now I’ve found Advanced Excerpt by Bas van Doren.
If you’re running a site that uses a magazine-style grid layout I’ve found this plug-in to be especially useful. I’m using Gazette Edition by Woo Themes, but I’ve modified it to make the pictures on the front page run the entire width of the previes boxes for each post. But, when I did this I found that those posts without photos would be much shorter than those with photos and consequently look very silly. I solved this with the Advanced Excerpt plugin-in.
After uploading and activating the plugin, the fix is fairly easy. By creating an if/else statement in PHP, I was able to call up two different excerpt lengths. If there is a photo, the excerpt is only 20 words. But, if there isn’t a photo, the excerpt will be 100 words, which just about perfectly matches a post with a photo and 20 words of excerpt.
The calls look like this:
<?php echo strip_tags(the_advanced_excerpt(‘length=20&use_words=1&no_custom=1&ellipsis=%26hellip;&exclude_tags=img,p,strong,font’), ‘<a><strong>’); ?>
<?php echo strip_tags(the_advanced_excerpt(‘length=100&use_words=1&no_custom=1&ellipsis=%26hellip;&exclude_tags=img,p,strong,font’), ‘<a><strong>’); ?>
Both are part of larger statments, but you get the idea. On my theme specifically I found that I had to repeat much of the code. In my case this looked like this:
If photo, then get the photo, the date, and a short excerpt.
If no photo, the get the date, and get a long excerpt.
In your specific case you may have to repeat other things like calling the author name or the title.
If you have questions about the plug-in, feel free to contact me or its author.

