Plugins
Limit-Post Add-On
Limit-Post is one of the better WordPress post content limiters we have come across, both in terms of usability and size. Developed by labitacora.net Limit-Post provides excellent control over the post character-length and even adds the ability to create “read more …” link with a single line of code.
From labitacora.net: “We have developed a plugin for WordPress in order to control the maximum amount of characters displayed for an entry on the main page. If the set limit is surpassed a link to a page with the whole content will appear and the text on the entry will be chopped to that amount of characters, otherwise the content will be show[n] unchanged.”
It came to our attention not long ago that we needed to make use of the WordPress tag; get_the_content. For those unfamiliar, WordPress supplies two methods of displaying the post content through php;
Option#1: the_content(); – The more familiar method of displaying the post content
Option #2: get_the_content(); – The less familiar content tag which strips all html tags
Option #2 is useful for listing articles or news without interruption of paragraph breaks, block-quotes or links which can easily disrupt a strict layout. Not wanting to reinvent the wheel, we wrote a short addition to the Limit-Post plugin giving it the added feature of the get_the_content(); tag.
In the example below, the post content is displayed with all html stripped out, 320 characters in length and a continue link of “read more…”. For further instructions on the Limit-Post options please visit labitacora.net. Limit-Post is a very resilient plugin having remained functional since it’s inception in 2005 during the WordPress 1.5 era. It continues to function perfectly with WordPress 2.7.1.
Please note that because all html is stripped, it will be necessary to add paragraph tags around the content.
Example
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php the_title(); ?> <p><?php get_the_content_limit(320, 'read more...'); ?></p> <?php endwhile; endif; ?>
Installation
- Download the plugin and expand it.
- Copy the limitpost-addon folder into your plugins folder ( wp-content/plugins ).
- Log-in to the WordPress administration panel and visit the Plugins page.
- Locate the Limit Post plugin and click on the activate link.
- Replace the_content(); with the_content_limit(200, "continue..."); or
- Replace the_content(); with get_the_content_limit(200, "continue...");
76 Comments
Trackbacks
- Limit-Post Add-On | Doc4 | WpMash - WordPress News
- wp-popular.com » Blog Archive » Limit-Post Add-On | Doc4
- [ Plugin ] Limit-Post Add-On - WordPress Tavern Forum
- [ Plugin ] Limit-Post Add-On - WordPress Forums



Gabriel,
Create the Custom Field by giving it a name and the selecting the ‘Add Custom Field’ button. Now add the link to the ‘value’ area like so: http://books.google.de/books?id=gr0H_1IcHN8C&lpg=PA48&dq=subject%3A%22Business%20%26%20Economics%22%20Rating&pg=PP1&output=embed. Now set up the code like this:
<iframe frameborder="0" scrolling="no" style="border:0px" src="<?php echo get_post_meta($post->ID, 'customFieldName', $single=true) ?>" width=620 height=620></iframe>Now all that is necessary is to get the book link and enter it into the custom field keeping it separate from your post content.
Doc,
I now got the custom field. In case of the google connected ebook I want to ad the following code to be displayed as an ebook:
<iframe frameborder="0" scrolling="no" style="border:0px" src="http://books.google.de/books?id=gr0H_1IcHN8C&lpg=PA48&dq=subject%3A%22Business%20%26%20Economics%22%20Rating&pg=PP1&output=embed" width=620 height=620></iframe>Do I then need it to put it under value?
Gabriel,
Click on Screen Options and check the box next to ‘Custom Fields’. Note that this option only appears if you are in a Post or Page. For example, on the Dashboard this is not an option under ‘Screen Options’
Edit: There are settings shown, but non of them are to be customized.