Just Custom Fields
[resolved] Duplicate images with just_custom_image (3 posts)

  1. aboutaaron
    Posted 3 years ago #

    For some reason when I use just_custom_image in my page template, it prints two images.

    Here's the code below:

    $args = array( 'numberposts' => 3, 'order'=> 'DESC', 'orderby' => 'post_date', 'category' => 258);
    $postslist = get_posts( $args );
    foreach ($postslist as $post) :  setup_postdata($post); ?>
      <div class="span2">
        <a href="<?php echo get_post_meta($post->ID, 'award-link', true); ?>">
          <?php echo just_custom_image($post->ID, 'award-image'); ?>
    <?php endforeach; ?>

    So this prints two img tags with uploaded image from the 'award-image' Custom Field.

    Any idea why?


  2. tebothibeau
    Posted 3 years ago #

    Not sure if you've solved this or not. Try removing "echo" from in front of just_custom_image.

    So it would be:

    <?php just_custom_image($post->ID, 'award-image'); ?>

  3. Alexander Prokopenko
    Plugin Author

    Posted 3 years ago #

    yeap, tebothibeau is correct.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Just Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic