• Hi,

    I have this problem when I used this plugin which displays related posts within the first post tag.

    <?php
    //for use in the loop, list 5 post titles related to first tag on current post
    $tags = wp_get_post_tags($post->ID);
    if ($tags) {
      $first_tag = $tags[0]->term_id;
      $args=array(
        'tag__in' => array($first_tag),
        'post__not_in' => array($post->ID),
        'showposts'=>15,
        'caller_get_posts'=>1
       );
      $my_query = new WP_Query($args);
      if( $my_query->have_posts() ) {
      echo "<b><center>Related Post</center></b>";
        while ($my_query->have_posts()) : $my_query->the_post(); ?>
          <ul><li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li></ul>
    
    <?php
        endwhile;
      }
    }
    ?>

    Below this code is another plugin which displays an image of the specific post

    <?php $image = get_post_meta($post->ID, 'thumbnail', true); ?>
    <?php if ( get_post_meta($post->ID, 'thumbnail', true) ) { ?>
    	<?php echo $image; ?>
    <?php } else {?>
    
    <?php } ?>

    What happens is when using both plugins, the image that appears is the image of the last post that was displayed on the related post by tag.

    My question is what should I change in the code so the right image will appear on the current post?

    Thanks!

  • The topic ‘Plugin changes the Post ID’ is closed to new replies.