Need thumbnail image from custom fields
-
Here’s the link to the page: https://www.jamandcheese.be/wordpress/2011/05/huisstijl-dierenarts-jeffrey-poppe/
I want to display a list of thumbnails in the sidebar, these thumbnails are stored in a custom field.
This is my code for the widget:
<?php $my_query = new WP_Query('category_name=drukwerk'); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <a class="side-thumb" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, 'img_thumb_list', true) ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>"/></a> <?php endwhile; ?>
So I use
?php echo get_post_meta($post->ID, 'img_thumb_list', true) ?>
to get the image in the custom fields, but it doesn’t work. If you check the generated code it shows the src=”” is empty!? What’s going wrong here?PS: I’m using this plugin PHP Code Widget.
- The topic ‘Need thumbnail image from custom fields’ is closed to new replies.