je le code suivant dans mon functions.php:Wordpress: obtenir des pièces jointes, mais pas après le pouce
function get_images($size = 'thumbnail') {
global $post;
return get_children(array('post_parent' => get_the_ID(), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID'));
}
Et dans mon single.php
<?php $photos = get_images('full'); ?>
<?php $x = 0; ?>
<?php foreach($photos as $photo): ?>
<?php if($x < 1): ?>
<img src="<?=wp_get_attachment_url($photo->ID)?>" alt="fullImg" />
<?php endif; ?>
<?php $x++;
?>
<?php endforeach; ?>
Je veux pour montrer juste UNE image là, mais il me montre aussi l'image post-thumb , que je ne veux pas, y at-il une option pour exclure cela?