WordPress plugins, themes, tips and hacks

My favorite WordPress tip

Saturday, September 8th, 2007

Blogging Challenge - Lorelle on WordPressIn Lorelle’s latest blog challenge, she asks us to describe our favorite WordPress tip. She says to think back to when we started experimenting with WordPress, and try to remember what tips we found valuable.

I started WordPress Garage in order to document my discoveries about WordPress. It was meant to serve as an online manual of sorts. So I decided to go back in time to see what I was blogging about close to the beginning of my WordPress journey.

I can see that the issues that interested me most at that time were related to optimizing blogs for search engines and readers. Here are the tips that most interested me at that time:

  • Tags - Tags are useful for more detailed categorization of posts, search engine optimization, and user navigation. I wanted to find the perfect tagging plugin that not only would add tagging, but enable me to create tag clouds and list related posts based on those tags, so that I could use one plugin for three features. First I tried Jerome’s Keywords Plugin, only to find that it didn’t work once I upgraded from WordPress version 2.1.1 to 2.1.2. I then tried out Simple Tagging, which works wonderfully and does everything I want it to do, and now use it on all WordPress blogs and sites that I build.
  • Excerpts - if you use <?php the_excerpt() ?> instead of <?php the_content() ?> in your template files so that certain pages automatically display excerpts instead of the full text of the post, all html tags are stripped from the text. That means that if you have images or links in the first paragraph or so of text, they are removed from the excerpt. Annoying. I searched for a solution and found The Excerpt Reloaded plugin. Only, it didn’t work quite right - if my excerpt had a bulleted list in it, for example, the entire page following that excerpt would be styled as one long list. But Rob, a blessed plugin developer, created a mod of the plugin that fixed this problem. I highly recommend using this plugin if you want to automatically display excerpts and retain the formatting.
    Excerpts and videos: even with Rob’s plugin, videos that are embedded in the beginning of any post will not appear in excerpts - only the code will. So far, the only way that I have found for displaying videos in excerpts is to stop using <?php the_excerpt() ?> and to manually insert excerpts.
  • Future posting - this is a tip that I learned from Lorelle. When I first started blogging, I would write five posts on one day, and then publish nothing for the next couple of days. Not a very good strategy, since people, and maybe even search engines, like to see new content on a daily basis. So I started future posting whenever possible, which gave me some peace of mind for a few days where I knew I could take a break from blogging.

The above tips are pretty basic, but I think they can mean the difference between a well optimized and usable blog, and one that doesn’t reach its potential.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Videos and excerpts don’t jive - and how to manually create excerpts

Tuesday, August 7th, 2007

I just discovered that videos do not show up when you are using excerpts (<?php the_excerpt(); ?>) on certain pages instead of publishing the full content (<?php the_content(); ?>) on the post.

I use Viper’s Video Quicktags for easily embedding videos in my blogs. Well, it turns out that instead of the video showing up on excerpt pages, the embedding code shows up instead.

Not very pretty.

Now, if you have a post, and there’s a video in it past the excerpt point, you’re ok. But I wanted to have a category that was kind of a like a vlog, where the post consists of a video and that’s it.

So I had to change all of my pages using the_excerpt (or The Excerpt Reloaded, which you should use to retain HTML formatting in your excerpts like links, bullets, etc.) to the_content.

But all is not lost - WordPress gives you two ways to manually generate excerpts that will appear on all multi-post pages, like the home page, archive page, and category page:

  1. The “more” tag and button. If you are using the WYSIWYG editor, there is a “Split post with More tag” button. It is the button directly to the left of the Spellcheck button (with the ABC on it). Place your cursor where you want to end the excerpt, and click on the button. Or, press Alt+t.
  2. Enter an excerpt in the Optional Excerpt field below the editor. I recently discovered that you can enter HTML in there, so if you want an image to appear in the excerpt, for example, you can enter the <a href=”"> tag and it works!

From a usability standpoint it’s probably better to manually create excerpts because they won’t cut sentences in the middle like the automatic feature does, and you can write a compelling teaser that will draw your reader in if you use the Optional Excerpt field.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Important mod to the Excerpt Reloaded Plugin

Wednesday, June 6th, 2007

A new mod to the Excerpt Reloaded Plugin means that now you can make sure that your excerpts are properly formatted with links, bullets, paragraphs and more. Read on…

For some reason which I still don’t understand, excerpts in WordPress are displayed without any HTML formatting. So if you use excerpts on your blog home page, or in your archives, then when people see these excerpts they cannot see any links, bullets, or even paragraphs since all of these tags are stripped. Instead, the excerpt is one big lump of text.

The only solution that I’ve been able to find is Kaf’s The Excerpt Reloaded Plugin. This plugin allows you to define certain HTML tags that will be retained in the excerpts. To do this, you replace the code in your template files that call the article text or excerpt with something that looks like the following:

<?php the_excerpt_reloaded(120, ?<a><img><p><ul><li><blockquote>?); ?>

“120″ is how many characters should be in the excerpt, and the list of tags are the tags that I want to be preserved in the excerpts.

However, I’ve found that some excerpt pages have formatting problems. For example, if one of the top excerpts on a page has a blockquote, the entire page following is one big blockquote. It seemed to me that the HTML closing tags were causing the problem, but seeing as I’m no PHP guru, I didn’t know how to go about fixing this.

This is where Rob comes into the picture. Rob created a mod of the Excerpt Reloaded Plugin that preserves the closing </p> tag. He posted a comment on my original post reviewing The Excerpt Reloaded Plugin to notify me of this plugin. I tried it out, but didn’t see any noticeable improvement, and told him so. Rob went back to the drawing board and fixed up his mod somehow so that closing tags appear, making the archives look normal!

If you want to have normal looking, user-friendly archives, get Rob’s mod of the Excerpt Reloaded Plugin here>>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Another way to prevent Google from spidering duplicate content: excerpts

Thursday, April 12th, 2007

As mentioned in a previous post, Google penalizes sites for duplicate content. One way of solving this is modifying the robots.txt file. Daily Blog Tips describes another way to prevent Google from finding duplicate content on your site: by using excerpts:

In order to make sure that you are not incurring any penalty for duplicated content you should make all those pages display only post excerpts instead of full posts. You could even display post excerpts on the Homepage…

This method involves modifying the theme files so that only specific pages will display excerpts.

Use Post Excerpts Everywhere>>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

You can offer a variety of feeds on your WordPress blog

Thursday, April 12th, 2007

Lorelle has a whole explanation on how to provide more than just post and comment feeds on your blog. She explains how to add category feeds, with or without RSS icons, making them auto-discoverable, and even add customizable keyword search feeds. She also discusses whether it’s preferable to offer full text or excerpt feeds to your readers. Specific feeds can increase the usability and attractiveness of your blog.

Understanding, Using, and Customizing WordPress Blog Feeds>>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

An Ajax variation on WordPress excerpts

Sunday, February 25th, 2007

The default WordPress excerpt allows you to display a short text from your posts that is easier taken from the post itself, or from the excerpt that you enter in the Write Posts page. At the end of the excerpt, there is a link that takes the reader to the complete version of the post, either to the point in the post after the end of the excerpt, or to the beginning of the post.

There are some limitations to the WordPress excerpt, including the fact that it strips the excerpt of all tags, something which can be solved by a The Excerpt Reloaded Plugin (see our review). Another limitation is the fact that a reader needs to load a whole new page to see the complete post, something which may lead readers to hesitate to click further.

The Inline Ajax Page plugin displays the full contents of your posts and comments in-line when a reader clicks to read more of an excerpt, without reloading the page or navigating away from your home page.

The plugin displays an excerpt of your post (the same way Wordpress does when you use the_excerpt or a < !–more–> tag), but rather than making the user go to another page to read the remainder of the post, this plugin uses Ajax to download and display the rest of it when the user clicks a link to read more. After wards the post’s content can then be hidden and the user can continue reading your other posts. It uses a similar method to display comments and the add comment box and to submit comments.

The Inline Ajax Plugin v2.1>>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

The Excerpt Reloaded

Saturday, February 24th, 2007

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:

  1. 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.
  2. 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(); ?>.
  3. 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>>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Premium News Themes