Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » Featured Image not working with NextGEN Gallery

  • Resolved system11


    Hi – I’ve come across a small problem, but I’m not sure if it’s related to my theme or not (2010 Weaver).

    If I edit a post, and add a Featured Image using the normal media library, back on the editing screen the image is shown in the Featured Image section. If I update the post and take a look at it, sure enough the header image is replaced with the featured one.

    However, if I select one through NextGEN Gallery and set one of the images to ‘Use as thumbnail’ (I assume this should work?), again the Featured Image section contains the photo I selected, but when I update the post and look at it, the header is just default.

    If I go back to edit the post, the Featured Image is still correct, it just doesn’t show up when I use NextGEN to pick it.

    Is this supposed to work? Could it be a problem with my theme and if so what should I change?

Viewing 15 replies - 1 through 15 (of 22 total)
  • Yes, you need to modify the theme… Where can I find your theme ? Is it available in the theme directory ?

    Ok, here it goes :

    Goto to header.php , line 102 -105 :

    if ( is_singular() &&
    has_post_thumbnail( $post->ID ) &&
    ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    $image[1] >= HEADER_IMAGE_WIDTH ) :

    and change it to :

    if ( is_singular() &&
    has_post_thumbnail( $post->ID ) ) :

    The main issue is that the size of a nextgen-gallery images cannot determined via a core function.

    Ok thanks, that seems to be nearly perfect! For some reason the featured image when set by NextGEN is 1 pixel narrower on each side than images set with other methods. Setting somewhere to do with padding maybe?

    Nice plugin by the way – your inbox should contain some appreciation 😉

    Thanks, Check the image size, does it have the same dimension like the default header image ? Have you a link as demo ?

    Hello Alex –

    I have a similar problem, I went to look for the code you mentioned in the header php but maybe it is located in a different area of my theme. If you have a moment can you take a look. Here the a link to the page with the featured image not showing


    John Kent

    Alex –

    I forgot to mention the theme I am using, here it is


    Here is the code for the header.php if you need it.

    <?php $gpp = get_option( ‘gpp_options’ ); ?>
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “”>
    <html xmlns=”” <?php language_attributes(); ?>>
    <head profile=”″>

    <title><?php wp_title( ‘-‘, true, ‘right’ ); echo wp_specialchars( get_bloginfo(‘name’), 1 ); ?></title>

    <meta http-equiv=”content-type” content=”<?php bloginfo(‘html_type’) ?>; charset=<?php bloginfo(‘charset’) ?>” />
    <meta name=”description” content=”<?php bloginfo(‘description’) ?>” />
    <?php if(is_search()) { ?>
    <meta name=”robots” content=”noindex, nofollow” />
    <?php }?>

    <!– BeginStyle –>

    <link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘stylesheet_url’); ?>” />
    <link rel=”stylesheet” href=”<?php bloginfo(‘template_directory’); ?>/styles/print.css” type=”text/css” media=”print” />
    <!–[if IE]><link rel=”stylesheet” href=”<?php bloginfo(‘template_directory’); ?>/styles/ie.css” type=”text/css” media=”screen, projection” /><![endif]–>
    <!–[if IE 7]><link rel=”stylesheet” href=”<?php bloginfo(‘template_directory’); ?>/styles/ie7.css” type=”text/css” media=”screen, projection” /><![endif]–>

    <!– EndStyle –>

    <!– Conditional Javascripts –>
    <!–[if IE 6]>
    <script src=”<?php bloginfo(‘template_directory’); ?>/includes/js/pngfix.js”></script>
    <!– End Conditional Javascripts –>

    <link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php if ( $gpp[‘gpp_feedburner_url’] <> “” ) { echo $gpp[‘gpp_feedburner_url’]; } else { echo get_bloginfo_rss(‘rss2_url’); } ?>” />
    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />

    <?php wp_head(); ?>
    <?php if ( is_singular() ) wp_enqueue_script( ‘comment-reply’ ); ?>
    <?php $homepage_design = $gpp[‘gpp_homepage_design’]; if ( $homepage_design == ‘slideshow’ || $homepage_design == ”) { ?>
    <style type=”text/css”>
    body.home { background: none; background-color: #000; }
    <?php } ?>

    <body <?php body_class(); ?>>

    <!– BeginHeader –>

    <p id=”hidep”><?php _e(‘— Hide menu’,’gpp_i18n’); ?></p>

    <div id=”menu”>
    <h2 class=”sitename”>” title=”<?php bloginfo(‘description’); ?>”><?php if($gpp[‘gpp_logo’]==”text”) { bloginfo(‘name’); } else { ?><img class=”title” src=”<?php if ( $gpp[‘gpp_logo’] <> “” ) { echo $gpp[‘gpp_logo_src’]; } else { bloginfo(‘template_directory’); ?>/images/logo.png<?php } ?>” alt=”<?php bloginfo(‘name’); ?>” /><?php } ?></h2>
    <div class=”description fancy”><?php bloginfo(‘description’); ?></div>

    <?php gpp_theme_nav(); ?>

    </div><!– #menu –>

    <!– EndHeader –>

    <?php $homepage_design = $gpp[‘gpp_homepage_design’];
    if ((is_home() && $homepage_design == ”) || (is_home() && $homepage_design = ‘slideshow’ )) {
    echo ‘<div id=”jbg-content”>’; }
    else {
    echo ‘<div class=”container”>’; }

    Hi Alex –

    I posted two posts for you to compare:

    As you can see, for some strange reason the NextGEN one is a pixel narrower on each side. The image uploaded to the standard and NextGEN galleries is the exact same image. If you look at the actual images, the standard one is 940×198 which is correct, but the one in the gallery cache -claims- to be 940×198, but is actually 938×198 – so I guess whatever code does the scaling for those cached images may have a small bug in it.

    OK , will look into this. Must be a ratio issue. Whatt size has the original image ?


    Yes, can reproduce it here. Will fix it in the next releaee

    Great news, thanks!



    Same problem here, uploaded pics show without problem, NGG featured image thumbnail in post is there but doesnt show in home page.



    Ok, I solved it. I just needed to check where my theme was adding the thumbnails, change the way it was doing it for:

    the_post_thumbnail(array(150,150, crop));

    So this force the thumbnails to be resized to 150×150 and crop them without keeping the aspect ratio.n Cool, so far.

    Interestingly, when I added “the_post_thumbnail(array(150,150, true));” that mean crop=true, but was adding the thumbnail cropped at 150×150 but it added the web20 effect!

    Hello! I am having a similar problem as wordpressuserjk

    I have a similar problem, I went to look for the code you mentioned in the header php but maybe it is located in a different area of my theme.

    with my Graph Paper Press theme Modularity. There are a few slider widgets I’m trying to use on the homepage, but none are showing the featured image. I’ve tried setting the preview image in Manage Gallery, and tried to use the featured image when composing a post (using the NextGEN gallery tab in the popup dialog), but neither seem to play nice with the PHP that GPP is using. Was this issue resolved? I am not very comfortable with PHP, but a cursory glance through the theme’s PHP files wasn’t very helpful. I can post code if needed!

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Featured Image not working with NextGEN Gallery’ is closed to new replies.