Pour une raison quelconque, je ne peux pas obtenir la pièce jointe à afficher si je passe dans $ attachment_id si je passe une valeur réelle dans 187 cela fonctionne. J'utilise WpAlchemy et le plugin Custom Image Sizes. Je pense queWordpress WP_Query
<section id="new">
<?php $myquery = new WP_Query(array('post_type' => array('post', 'website_gallery'),'showposts' => '2'));
while ($myquery->have_posts()) : $myquery->the_post();
global $custom_metabox;
?>
<div class="latest hentry">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php $website_gallery->the_meta(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<img src="<?php $website_gallery->the_value('galleryimage');?>" alt="<?php the_title(); ?>">
</a>
<?php echo wp_get_attachment_image($attachment_id, '220x80'); ?>
</div>
<?php endwhile; wp_reset_query(); ?>
</section>
Où définissez-vous attachment_id de $? –