WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] [closed] Featured Image not working with NextGEN Gallery (23 posts)

  1. system11
    Member
    Posted 3 years ago #

    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?

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

  2. Alex Rabe
    Member
    Posted 3 years ago #

    Yes, you need to modify the theme... Where can I find your theme ? Is it available in the theme directory ?

  3. system11
    Member
    Posted 3 years ago #

  4. Alex Rabe
    Member
    Posted 3 years ago #

    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.

  5. system11
    Member
    Posted 3 years ago #

    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 ;)

  6. Alex Rabe
    Member
    Posted 3 years ago #

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

  7. wordpressuserjk
    Member
    Posted 3 years ago #

    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

    http://sffilepull.com/category/live-work/

    Thanks

    John Kent

  8. wordpressuserjk
    Member
    Posted 3 years ago #

    Alex -

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

    http://graphpaperpress.com/themes/widescreen/

    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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head profile="http://gmpg.org/xfn/11">

    <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>
    <![endif]-->
    <!-- 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; }
    </style>
    <?php } ?>
    </head>

    <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">'; }
    ?>

  9. system11
    Member
    Posted 3 years ago #

    Hi Alex -

    I posted two posts for you to compare:

    http://psu.system11.org/blog/?p=395
    http://psu.system11.org/blog/?p=397

    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 940x198 which is correct, but the one in the gallery cache -claims- to be 940x198, but is actually 938x198 - so I guess whatever code does the scaling for those cached images may have a small bug in it.

  10. Alex Rabe
    Member
    Posted 3 years ago #

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

  11. system11
    Member
    Posted 3 years ago #

    1280x720

  12. Alex Rabe
    Member
    Posted 3 years ago #

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

  13. system11
    Member
    Posted 3 years ago #

    Great news, thanks!

  14. medinauta
    Member
    Posted 3 years ago #

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

  15. medinauta
    Member
    Posted 3 years ago #

    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 150x150 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 150x150 but it added the web20 effect!

  16. CuedUp
    Member
    Posted 3 years ago #

    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!

  17. Semtex
    Member
    Posted 3 years ago #

    Is there any universal solution for this problem? My theme files (custom-community) doesn't have any "if ( is_singular() ..." or "the_post_thumbnail(array... " lines, but i still badly need a fix for this. Thanks.

  18. bleggate
    Member
    Posted 3 years ago #

    I am having the same issues. I have a child theme on a genesis frame work and changing the header php is not reccommended. is there a hook I can insert in simple hooks or do you have some other solution to this?

  19. D C
    Member
    Posted 3 years ago #

    I'm having the same issue as everyone else. Like @bleggate I'm using a Studio Press /Genesis framework called "Amped". When I posted this issue on the Studio Press forum I got the following response:

    The featured image works with WordPress Image Gallery, it is using WordPress functions to pull the thumbnail or first attached image. If you aren't seeing images, then the NextGen gallery isn't integrating into WordPress image gallery correctly.

  20. myfairladyah
    Member
    Posted 3 years ago #

    I'm also using a Studio Press Genesis Theme - Mocha. I would really like to use NextGen Gallery thumbnails for Featured Images without having to have a copy of my thumbnails uploaded to the WP Media Library.

    Any help is appreciated. Thanks.

  21. Anambra
    Member
    Posted 3 years ago #

    guys I am experiencing the same or very closely related issue here. The featured photos are there alright but very blurred when they appear on the featured slider. Any detailed solution to this will be greately appreciated. I am new with this..lol...currently using the newpro theme

  22. clarkkent93
    Member
    Posted 3 years ago #

    I'm using the ATOM theme and having the same issue using NextGen Gallery for the Featured Image. The affected page is here.

    Normally, if I would choose an image (using native gallery) to be used in a post, that image itself would be used as the featured image. It didn't happen in this instance, so I chose the image using NextGen Gallery for the Featured Image. When you look at the home page, it removes the placeholder for the featured image and moves the entire post over to the left.

    Does anybody have an idea what I need to do to correct this issue? I hope I've made everything clear what I'm working with. Thanks!

    DoddemaGen

  23. elfin
    Moderator
    Posted 3 years ago #

    @clarkkent93 please start a new thread.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.