Add a different image to the sidebar on each page using pages custom fields. I have found some PHP code which may be useful but I have been unsuccessful making it work. Here is the code that I have tried to use by placing it in a text box in the sidebar widget:
<!-- Sidebar Images -->
<div class="side_box" style="display: block">
<?php rewind_posts(); /*enables query data to be passed over again in another loop*/ ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Do stuff... -->
<?php $sidebar_images = get_post_meta($post->ID, 'sidebar-image', false); //get the list of values associated with the key "sidebar-image"
if ($sidebar_images){ /*if non-empty list*/ ?>
<h3>custom fields:</h3>
<ul>
<?php foreach($sidebar_images as $sb_image) {
echo '<li>'.$sb_image.'</li>';
} ?>
</ul>
<?php } ?>
<?php endwhile; ?>
Experienced WordPress developer here, can provide exactly what you need, can you show me the site and please let me know if you have the custom field image type for each page in wp-admin?
Thanks