Tag Archives: Wordpress Excerpt

Cyber Excerpt WordPress Plugin

This plugin will help solve several issues using the Excerpt instead of the Content on a WordPress blog. A lot of WordPress blogs will use the excerpt on several pages other than the single post page to keep the blog clean and duplicate content down. With Cybers Excerpt Plugin you can take this to a new level, including the following capabilities.

  • Change the word count for the excerpt
  • Set a custom word count by page type, such as, Index, Archive, Tag, Category or Search Results.
  • Applies a more link at the end of each post that includes the Title.

Here is an example of the transformation from full content to a custom CybersExcerpt on a Home Page.

This first image is of a post with the standard full content displaying for each post on the home page. This style takes up a lot of room on the main page and gives the reader the exact duplicate content that will appear on the Post page.

Pot using standard full content

Using the standard Excerpt can be very helpful in reducing the size and duplicate content on a site. Notice that the formatting is off a little as the Excerpt does not handle the paragraph and breaks very well, and there is no link to read more at the bottom of the post. The Standard length is 55 words.

Post using standard Excerpt

Here is the same page formatted with the Cybe Excerpt. The default length is 50 words but can be easily changed in the Settings option within WordPress without changing any code. Also notice that we have taken care of the paragraph and break formatting to give the excerpt and much cleaner look. And last, but not least, there is a link at the bottom of the post to direct the reader to the full post.
 

Post using custom CyberExcerpt

Add to CartView Cart

Alternate Background Color of Blog Posts

As my tag pages grow I have been contemplating how I wanted to handle their appearance. The goal is to have as many post excerpts as possible on each tag page while creating a page that is easy to read. I decided to try something a little different that I have not seen on too many blogs, actually, I am not sure I have seen it at all except on some comments, which is alternating the background color of each post.

So, how hard would this be?

It took about an hour to get it the way I wanted it. I am alternating the background color and the Adsense ads on each tag page. A good example is the Google Tag Page since it has a lot of posts.

Rotate Background

Here is a summary of how I did this:

Create a loop counter. Right before the Loop begins set a variable to zero.

<?php
$x=0;
if (have_posts()) : ?>

At this point I would want the Background Color to change, insert code to test for an even number post, and if this is true, add an inline CSS style for the background that would override the stylesheet.

<?php if ($odd = $x%2){?>
<div style=”background-color:#404040;padding:10px 0px 10px 10px;”>
<?php }?>

Then, where the background color should return to the original state, run the same test for the even numbered post and close the div tag set by the Inline Style.

<?php if( $odd = $x%2 ){?>
</div>
<?php }?>

The final step is to add 1 to the counter for each post, which is done at the end of the loop.

<?php
$x++;
endwhile; ?>

Not sure if anyone else likes this style, but it sure seems to make the excerpts easier to read for me. Please let me know what you think ?

WordPress Excerpt Plugin

I created this little plugin for my own use, and after reading today’s post over at HackWordPress.com it reminded me that Garry Conn had asked me if I was going to publish it, so here it is.

I like to use the the_excerpt() instead of the_content() in several places on a blog. However, I did not like the fact that the_excerpt was only showing 55 characters. I could change it in the WordPress code, but then everytime I update the blog with a new version of WordPress I have to remember that the change is there.

CyberExcerpt is simply a copy of the_excerpt routine in a plugin. The advantage to this is I can change the_excerpt length, turn on the plugin and I have my solution, a longer excerpt.

If you want an excerpt with a length other than 55 characters, just download the zip file, unzip, and then upload the CyberExcerpt folder to the /plugin folder and change the value in line # 24, then call the_excerpt() as you normally would.

$excerpt_length = 100;

Download CyberExcerpt