Here is an option though I’m not sure it will work as your expecting.
It works like this:
You need to upload the images you’ll be using so they are in the media library. Once the images have been uploaded, navigate to the media library and look for the link that says unattached.
–
Find the image you want to use and click on the attach to post link as shown here:
Type the post name or a word in the post title and click search.
Once you’ve found the post you want to attach the image to click on the radio button and then the select button to attach it to the post:
Now you have attached the image to a specific post but you still need some code to make it show up in the post. In the code below I’ve used an additional loop to display the first image attached in a post (this is why I said I’m not sure if it will work for you, if it doesn’t work, there are a few things you can change).
Here is an example I used in an old theme I had laying around. The first loop displays the post text and the second displays the image you attached earlier:
<?php get_header(); ?>
<!-- The Loop to display your post text: -->
<?php if (have_posts()) : while ( have_posts() ) : the_post(); ?>
<div class="singlepost" id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div class="entry">
<?php the_content(); ?>
</div>
</div>
<?php endwhile; ?>
<!-- Reset query so we can include the attached image in a second loop. -->
<?php wp_reset_query(); ?>
<ul class="custom-attachment">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts( $args );
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
echo '<li>';
# To Link to large medium or small (thumbnail)
# uncomment the appropriate line below to display that size image:
echo wp_get_attachment_image( $attachment->ID, 'full', false );
// echo wp_get_attachment_image( $attachment->ID, 'medium', false );
// echo wp_get_attachment_image( $attachment->ID, 'thumbnail', false );
echo '</li>';
}
}
endwhile; endif;
?>
</ul>
<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>