Get Custom Field Image Loop
-
Hi everyone, I have this code
<?php $imagem = new WP_Query(array( 'post_type' => 'post', 'posts_per_page' => -1, //Se deixar em branco ele pega o default do Admin, Deixe -1 para ilimitado 'meta_key' => 'imagem', //Aqui fica o name do seu custom_field (é o que está no select dropdown) 'orderby' => 'meta_value', //Deixe assim 'order' => 'DESC', //Do maior para o menor, mude para ASC se quiser do menor para o maior. 'category_name' => 'outfits' )); while ($imagem->have_posts()): $imagem->the_post(); $link = get_post_meta( $post->ID, 'imagem', true ); echo ' <ul>'; echo ' <li><a href="#"><img src="'.$link.'" width="621"/></a></li> '; echo '</ul> '; endwhile ?>
[Please post code & markup between backticks or use the code button. Your posted code has now been permanently damaged by the forum’s parser.]
I wanna that this code return me a imageof custom field in loop. Just one image appear. I wanna + images. How I do this? Thank you.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Get Custom Field Image Loop’ is closed to new replies.