WordPress.org

Ready to get started?Download WordPress

Forums

JM Twitter Cards
Support for NextGen Gallery (3 posts)

  1. techraf
    Member
    Posted 1 year ago #

    When featured image of a post was taken from NextGen Gallery, this plugin returned an empty string in twitter:image property.

    I managed to get it working (per this article) by replacing:

    $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );

    with:

    $id = get_post_thumbnail_id();
              if(stripos($id,'ngg-') !== false && class_exists('nggdb')){
                   $nggImage = nggdb::find_image(str_replace('ngg-','',$id));
                   $thumb = array(
                        $nggImage->imageURL,
                        $nggImage->width,
                        $nggImage->height
                   );
              }else{
                   $$humb = wp_get_attachment_image_src($id,'full', true);
              }

    Would you consider adding this to your plugin for future?

    It would require a bit more work for gallery cards, I guess...

    http://wordpress.org/extend/plugins/jm-twitter-cards/

  2. jmlapam
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for reporting.

    I'll see what I can do to make it work with NGG :)

  3. jmlapam
    Member
    Plugin Author

    Posted 1 year ago #

    I've been running some tests. Dude this does not come from my plugin but from NGG itself !

    So thanks for the tip but I wonder if it's really a good idea to include such an hack to my plugin. I mean this is more logical NGG fix that bug and then we'll see if it works with my plugin.

    Once again, thanks for sharing this tip. It will help people in the same case.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.