April 1, 2008

Wordpress Tip: How to Show a Complete Post in Category Archive View


On a another blog I run in which I use the PlainTxt Wordpress theme, I noticed that often Google would link to a category of my site, but when you navigated to that part of my blog, all that would appear were partial posts with no graphics. It looked crappy, like the searcher accidentally clicked on a spam blog or something. I wanted to fix it. Unfortunately, it took me a couple hours to figure it out.

The answer lies deep in the bowels of the Wordpress code in the archives.php file. In the code there is a call for something called "the_excerpt," which strips down each post to the barebones and removes any graphics. To get your Wordpress blog to show the full post, graphics and all, simply replace the_except with the_content. Check it out, the full posts.

Now hopefully people who navigate to your categories view will stick around a little longer after thinking they have the full site available to them and not a bunch of spam.

No comments: