WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. daigreen
    Member
    Posted 1 year 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>';

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

  2. Alex Mansfield
    Member
    Plugin Author

    Posted 1 year 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

About this Topic