Support » Plugin: Latest Posts by Author » Limit numbers of characters

  • Resolved David


    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>';

Viewing 1 replies (of 1 total)
  • Plugin Author Alex Mansfield


    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' );
Viewing 1 replies (of 1 total)
  • The topic ‘Limit numbers of characters’ is closed to new replies.