WordPress.org

Ready to get started?Download WordPress

Forums

Latest Posts by Author
[resolved] Adding a photo (3 posts)

  1. spultured
    Member
    Posted 2 years ago #

    Let me preface this by saying I am a wordpress newbie. I can't for the life of me figure out how to insert a thumbnail with the post links which I am inserting onto a page. Could someone please show me the exact code which would enable me to do this? Much appreciated :)

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

  2. Alex Mansfield
    Member
    Plugin Author

    Posted 1 year ago #

    Adding the following code to the functions.php file of your theme will add thumbnail support to the plugin:

    function latestbyauthor( $content ){
    	global $post;
    	return $content . get_the_post_thumbnail( $post->ID );
    }
    add_filter( 'latestbyauthor_link_before', 'latestbyauthor' );

    I'm not sure where you want the thumbnails to be placed, but you can play around with the placement by changing "latestbyauthor_link_before" to any of the following values:

    • latestbyauthor_link_before
    • latestbyauthor_title_before
    • latestbyauthor_title_after
    • latestbyauthor_link_after

    To change the thumbnail size, you'll need to tell the "get_the_post_thumbnail" function what size image you want to use. For more information on that function, see: http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail

  3. Alex Mansfield
    Member
    Plugin Author

    Posted 1 year ago #

    Marking as resolved. Let me know if you have any further questions.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.