• I am using NextGen Gallery for all images on my site including the featured images. Now while I can return the featured images using: the_post_thumbnail( 'thumbnail' )

    I need to be able to adjust the size of this image slightly. Using the arrary feature hasn’t worked as it returns a resized version of the full image.

    What I want to do is somehow return the URL of the featured image only and not the rest of the code that comes with the_post_thumbnail. This is easy enough when dealing with images through the WordPress Media library, using:

    $image_id = get_post_thumbnail_id();
    $image_url = wp_get_attachment_image_src($image_id,'thumbnail');
    $image_url = $image_url[0];

    but with the NextGen Gallery images this isn’t return anything.

    Any ideas?

    https://www.ads-software.com/extend/plugins/nextgen-gallery/

Viewing 1 replies (of 1 total)
  • I had the same question, and using the help from this post:
    https://kaptinlin.com/support/discussion/1446/nextgen-featured-image-in-posts/p1

    I was able to modify my function to do something similar:

    // Check to see if NextGen Gallery is present
    function get_image_path() {
     global $post;
     $id = get_post_thumbnail_id();
     if(stripos($id,'ngg-') !== false && class_exists('nggdb')){
     $nggImage = nggdb::find_image(str_replace('ngg-','',$id));
     $thumbnail = array(
     $nggImage->imageURL,
     $nggImage->width,
     $nggImage->height
     );
     } else {
     $thumbnail = wp_get_attachment_image_src($id,'full', true);
     }
     $theimage = $thumbnail[0];
     return $theimage;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: NextGEN Gallery] Find URL of Featured Image’ is closed to new replies.