WordPress.org

Ready to get started?Download WordPress

Forums

Latest Posts by Author
Limit numbers of characters (2 posts)

  1. bender001
    Member
    Posted 3 years ago #

    Hey, awesome plugin!

    Can I somehow limit number of characters that are shown by your plugin? something like excerpt function?

    I would like to show only like 80 chars.

    Thanks!

    http://wordpress.org/extend/plugins/latest-posts-by-author/

  2. Alex Mansfield
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, you could use the substr() PHP function to limit the number of characters. I'm not sure if you're trying to limit the number of characters in the title, or in the excerpt. If you were trying to limit the number of characters in the title, you would want to change line 24 of the plugin to look like this:

    $html .= '<li><a href="'.$numpost->guid.'">'.substr($numpost->post_title, 0, 10).'</a>';

    To limit the excerpt, you would use the same substr() function to wrap the $numpost->post_excerpt variable.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic