WordPress.org

Ready to get started?Download WordPress

Forums

Post Tiles
[resolved] Using NextGen Gallery thumbnails (2 posts)

  1. CoCha
    Member
    Posted 1 year ago #

    Out of the box Post I was unable to use NextGen's thumbnails.
    So I changed the code a bit. pst-files.php line 459 became:

    // Retrieve the featured image.
    				  $id = get_post_thumbnail_id();
                      if(stripos($id,'ngg-') !== false && class_exists('nggdb')){
                          $nggImage = nggdb::find_image(str_replace('ngg-','',$id));
    					  $nggThumb = $nggImage->imageURL;
    					  // split URL in order to recreate an URL to the NextGen thumb
    					  $thePath  = pathinfo( $nggImage->imageURL );
    					  $nggThumb = $thePath['dirname'] . "/thumbs/thumbs_" . $thePath['basename'];
                          $thumb = array(
                              $nggThumb,
                              $nggImage->width,
                              $nggImage->height
                          );
                      } else {
                          $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), array(350,350));
                     }

    I also made a little change to $featured-style (line 462)

    $featured_style = "style='background: url(".$url.") 0 0; background-size: contain;' class='featured-image ".$animation_style."'";

    Now post-tiles shows nextgen's thumbnails.

    http://wordpress.org/extend/plugins/post-tiles/

  2. ethanhackett
    Member
    Plugin Author

    Posted 1 year ago #

    CoCha,

    Thanks for posting this fix here. I'm not sure if there's a way to make the plugin work universally with other image plugins. So thanks for posting your updates. What I might do is add a link to this post in the FAQ document incase someone want's to use NextGen's gallery too. It's a great plugin and I use it too here and there.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.