WordPress.org

Ready to get started?Download WordPress

Forums

Network Latest Posts
[resolved] class for thumbnail (2 posts)

  1. sergeyzimin
    Member
    Posted 2 years ago #

    if we gonna use an attribute 'size' then we need implement another attribute 'image_class'.

    ____________________________________________________
    function network_latest_posts($how_many=10, $how_long=0, $titleOnly=true, $begin_wrap="\n

  2. ", $end_wrap="
  3. ", $blog_id='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, $size = 'thumbnail' , $image_class='post-thumbnail' ) {
    _______________________________________________________________
    $attrs = array('class'=> $image_class);
    $thumbcode = str_replace( $current_blog->domain . $current_blog->path, $blogdetails->domain . $blogdetails->path, get_the_post_thumbnail( $post_id, $size, $attrs ) );
    ________________________________________________________________
    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,
    'size' => 'thumbnail',
    'image_class' => 'post-thumbnail'
    ), $atts));
    _____________________________________________________________________
    function the_post_thumbnail_by_blog($blog_id=NULL,$post_id=NULL,$size='thumbnail',$image_class,$attrs=NULL) {
    return get_the_post_thumbnail_by_blog($blog_id,$post_id,$size,$image_class,$attrs);
    }
    __________________________________________________________________
    function get_the_post_thumbnail_by_blog($blog_id=NULL,$post_id=NULL,$size='thumbnail',$image_class,$attrs=NULL) {
    _________________________________________________________
    echo '</span>'.the_post_thumbnail_by_blog($blognlp,$thispost[$i]->ID,$size, $image_class).'<p class="network-posts-excerpt">';
    _______________________________________________________________

    and now we can set our own class for thumbnail image. Try image_class=' alignleft'

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

  • Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 2 years ago #

    Hello Sergey,

    Thanks for your feedback, this is a good idea. I'm entirely rewriting this plugin to make it easier to maintain, improve the features and remove some buggy behaviors included in the initial releases.

    The new version will be better in many ways, this will be included for sure. I will be releasing the version 3 soon.

    Cheers.

  • Topic Closed

    This topic has been closed to new replies.

    About this Plugin

    About this Topic

    Tags

    No tags yet.