WordPress.org

Ready to get started?Download WordPress

Forums

Network Latest Posts
[resolved] diffrent size for thumbnails (2 posts)

  1. sergeyzimin
    Member
    Posted 1 year ago #

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    You need to add:
    _____________________________________________________

    function network_latest_posts_shortcode($atts){
        // Constructor
        extract(shortcode_atts(array(
            'title' => null,
            'number' => '10',
            'days' => '0',
            'titleonly' => true,
            'wrapo' => null,
            'wrapc' => null,
            'blogid' => 'null',
            'thumbnail' => false,
            'cpt' => 'post',
            'ignore_blog' => 'null',
            'cat' => 'null',
            'tag' => 'null',
            'paginate' => false,
            'excerpt_length' => 'null',
            'display_root' => false,
            'auto_excerpt' => false,
            'full_meta' => false,
             <strong>'size' => 'thumbnail'</strong>
        ), $atts));
        // Avoid direct output to control the display position
        ob_start();
        // Check if we have set a title
        if( !empty( $title ) ) { echo "<div class='network-latest-posts-sectitle'><h1>".$title."</h1></div>"; }
        // Get the posts
    ___________________________________________________________________
    network_latest_posts($number,$days,$titleonly,$wrapo,$wrapc,$blogid,$thumbnail,$cpt,$ignore_blog,$cat,$tag,$paginate,$excerpt_length,$display_root,$auto_excerpt,$full_meta, <strong>$size</strong>);
    ____________________________________________________________________
    
    $blogdetails = get_blog_details( $blog_id );
    <strong>$size=explode('X',$size);</strong>
    $thumbcode = str_replace( $current_blog->domain . $current_blog->path, $blogdetails->domain . $blogdetails->path, get_the_post_thumbnail( $post_id, $size, $attrs ) );
    ____________________________________________________________

    and now you can use additional attribute in short code size='100X100'

    http://wordpress.org/extend/plugins/network-latest-posts/

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Sergey,

    It's funny, I'm reading this after applying the same idea into the version 3. I added the parameter thumbnail_wh where you can specify the width & height in that form (100x100).

    Thanks for your messages and feedback.

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.