Plugin Description
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.
Because the developer's site is no longer functional we will keep this plugin updated for as long as possible. Below is the content from labitacora.net that was included with the original plugin, it's not much but here it is.
"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."
A practical case: Replace the line the_content() in the index.php file with: the_content_limit(1000, "Read more")
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 we are modifying a WordPress loop. The loop displays your post content and is located in many places throughout your WordPress theme. To begin, locate the PHP file containing the posts you wish to alter with Limit-Post and search for the loop within that file. The loop should look similar to the sample provided below.
For example, let's say you wanted to use Limit-Post on your Index.php (Also known as your Home Page or Main Index Template). Visit your WordPress dashboard and click on "Appearances > Editor" now locate "Main Index Template" from the list of files on the right hand side and search for the loop. Keep in mind that your theme may not be using the Main Index Template in a similar manner therefore you may need to search through other php template files (on the right hand side of this same page) until you find the loop you need. Once you have found the correct loop make the changes per the instructions.
In our example below the post content is displayed with all html stripped out, 320 characters in length and a continue link of "read more…". Change the variables [320] and [read more...] to suit your needs.
Example
|
1 2 3 4 |
<?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; ?> |
Please note that because all html is stripped, it will be necessary to add paragraph tags around the content.
DOWNLOAD DONATEInstallation Instructions
- 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...");
93 Comments, Questions & Answers
- [ Plugin ] Limit-Post Add-On - WordPress Forums
- [ Plugin ] Limit-Post Add-On - WordPress Tavern Forum
- wp-popular.com » Blog Archive » Limit-Post Add-On | Doc4
- Limit-Post Add-On | Doc4 | WpMash - WordPress News
- How To limit the displayed text length on your Homepage - WordPress Plugin | MindPrompter.com
Man, you def need better documentation…
Rob,
This plugin was not written by us, we simply included a few additional lines of code. Rather than steal the credit from the proper source it is expected that a user would visit labitacora.net for the full documentation on using the "Limit Post" plugin.
Please let us know how we can make the documentation to this plugin better and let us know where the confusion is. For WordPress beginners it's important to note that you will be looking for a snippet of code that looks like this (the_content) within your theme's php pages. Appearance > Editor will list these pages. Search for the location you would like to use this plugin and change (the_content) to (the_content_limit(320, 'read more…')). Hope this helps a little. Keep in mind that some purchased themes may make it more difficult to locate this snippet or may be using an entirely different method of displaying the content altogether. If you need help please email us.