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

  1. David
    Posted 2 years ago #

    Hey bud i've contacted you before on this problem i always seem to have with this plugin. Btw thanks fot the help last time :)

    Here is the old code from the old version which you helped me fix before:

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

    Here is the new code from the new verion and i can't find a way to limit the number of chars? If you could help me out on this i would appreciate it?

    $html .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a>';


  2. Alex Mansfield
    Plugin Author

    Posted 2 years ago #

    I just added filters to the plugin, so you can now add the following code to the functions.php file of your theme to limit the number of characters in the post title:

    function latestbyauthor_shorten_title( $content ){
    	return substr( $content, 0, 52 );
    add_filter( 'latestbyauthor_title', 'latestbyauthor_shorten_title' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Latest Posts by Author
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic