Forums

NextGEN Gallery
[resolved] To get Full or SinglePic for post featured image (1 post)

  1. dingwen
    Member
    Posted 3 months ago #

    Doesn't matter what I set in the_post_thumbnail() function it shows only thumbnail. I dig around and found ngg_post_thumbnail() in post-thumbnail.php which is responsible for outputting image HTML.

    The function doesn't check

    the_post_thumbnail('thumbnail'); // Thumbnail (default 150px x 150px max)
    the_post_thumbnail('medium'); // Medium resolution (default 300px x 300px max)
    the_post_thumbnail('large'); // Large resolution (default 640px x 640px max)
    the_post_thumbnail('full'); // Full resolution (original size uploaded)
    borrowed from http://codex.wordpress.org/Function_Reference/the_post_thumbnail

    Since I the options in NGG panel only has thumbnail, Full, and SinglePic, I just replace $img_src = $image->thumbURL; around line 121 in post-thumbnail.php with the following code.

    if($size === 'full' or $size === 'singlepic')
    {
        $img_src = $image->imageURL;
    }
    else
    {
        $img_src = $image->thumbURL;
    }

    After this you can use

    the_post_thumbnail('full');
    or
    the_post_thumbnail('singlepic');

    Hope this will help some people.

    http://wordpress.org/extend/plugins/nextgen-gallery/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.