Viewing 2 replies - 1 through 2 (of 2 total)
  • Ayman

    (@aymanalzarrad)

    Try using this:

    <?php
      $src = '<?php bloginfo('template_directory'); ?>/images/default-category-image.jpg" alt="<?php the_title(); ?>'
          if (is_category('XXXX')) {
          the_post_thumbnail('thumbnail', array('$src'));
    }
    ?>

    Thread Starter 4Gui

    (@4gui)

    Thanks for your answer but unfortunately it doesn’t help me.
    I got this code in header which work great in Facebook developers debug, share, like, etc…but not with this plugin cause he always grab the featured image thumbnail not the og:image?

    <?php if ( in_category( 'x' )) { ?>
    					<meta property="og:image" content="<?php $post_thumbnail = bloginfo('template_directory') . '/images/x.png'; echo $post_thumbnail; ?>" />
                        <link rel="image_src" href="<?php $post_thumbnail = bloginfo('template_directory') . '/images/x.png'; echo $post_thumbnail; ?>" / >
    				<?php } else { ?>
                <meta property="og:image" content="<?php $post_thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'large'); echo $post_thumbnail[0]; ?>" />
                 <link rel="image_src" href="<?php $post_thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'large'); echo $post_thumbnail[0]; ?>" / >
                <?php } ?>

    I believe the changes have to be done in how the plugin grabs the thumbnail and i tried it but again without success.
    Help please.
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: NextScripts: Social Networks Auto-Poster] Facebook Conditional Thumbnail’ is closed to new replies.