Wordpress plugin: recent posts list with short titles 24 August 2006, 16:53
Posted by Orhan in : Geeky Techy Stuff, WP-Plugins , 24 commentsUpdated: 06/18/2007 - Ver 1.06
For those who have experienced problems with WP 2.2, try this version 1.06..
——————————————————————————
I have searched for a long time and was unasble to find a plugin that can display recent posts with short titles so that the list is read one post per line.
Then I realized this was a good opportunity to write my own (and first) Wordpress plugin.
What it does is that it lists the recent posts just like wp_get_archives() function but an additional parameter sets the limit of the post title length as characters. Only the first X characters of the post title is displayed. The full name can still be read if the mouse is pointed on the links.
Current Version 1.06: -strip_tags on shortened titles eliminates html tag errors, this version should also work with no problems in WP 2.2
—V1.06 Download oden_latest_posts.txt (rename to oden_latest_posts.php)
Version 1.05: Converted for WP 2.1.x to fix a bug which caused static pages to appear in the list. I am not sure if it will work with WP ver. 2.0.x! WP 2.0.x users, do not upgrade at this time if you do not have any problems.
Version 1.04: Added offset feature. Skip the first n posts when listing. Also, when you move along the pages, it automatically skips the posts on thatpage too.
—V1.04 Download oden_latest_posts.txt (rename to oden_latest_posts.php)
Installation:
- Put oden_latest_posts.php file under wp-contents/plugins folder
- Activate ODEN latest posts in admin panel plugin area
Usage:
oden_wp_get_archives(…, $title_limit=XX, $oden_offset=XX);
where XX is the number of characters you would like to limit the post titles in the recent posts list.
Example:
<?php if($paged || is_home()) _e(’Earlier Posts’); else _e(’Recent Posts’); ?>
<ul><?php oden_wp_get_archives(’type=postbypost&limit=20 &title_limit=34&oden_offset=10′); ?></ul>
Note: put no space before &title_limit. I had to put a space because it did not fit here!
Demo: In the side bar recent/earlier posts.
Hope someone else finds it useful too!