• Resolved antirem

    (@antirem)


    On the right hand side of my blog I want an image listing of each and every post (I’ve added the images etc..)

    The below code works great, IF it is on the homepage.

    <?php if (have_posts()) : ?>
      <?php while (have_posts()) : the_post(); ?>
        <?php if(get_post_meta($post->ID, "small-image", true)) : ?>
          <a href="<?php the_permalink(); ?>" class="thumbnail"><img src="<?php echo get_post_meta($post->ID, "small-image", true); ?>" /></a>
        <?php endif; ?>
      <?php endwhile; ?>
    <?php endif; ?>

    When this code is on any specific blog post it will only find the image for the current post.

    What is the post call that I need to use for it to act like it is starting at the root of my site?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Post listing within a post’ is closed to new replies.