Campos personalizados Loop
-
Olá Pessoal, Estou com um pequeno problema criei um campo personalizado que me retorna imagens adicionadas. Este é o código abaixo:
`<div class=”slide-single”>
<?php// args
$args = array(
‘numberposts’ => -1,
‘post_type’ => ‘post’,
‘meta_key’ => ‘imagem’,
‘post_status’ => null,
‘category_name’ => ‘gourmet’);
// get results
$the_query = new WP_Query( $args );// The Loop
?><ul id=”slideshow”>
<?php if( $the_query->have_posts() ): ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>- <img src=”<?php echo get_post_meta( get_the_ID(), ‘imagem’, true ) ?>” alt=”<?php the_title(); ?>” />
<?php endwhile; ?>
<?php endif; ?><?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
</div>Meu problema é, as fotos que vão sendo adicionadas só fica a última foto, estou integrando com o slide e queria que aparecesse no mínimo 5. Como posso fazer isto? Desde já agradeço 🙂
- O tópico ‘Campos personalizados Loop’ está fechado para novas respostas.