Вывести превьюшки на главной можно средствами самого вордпресса, не колдуя с custom fields. Надо добавить код на главную, архивы или где еще надо выводить тумбы. Я вот топорно так вывел, но думаю смысл понятен
[audio:http://alexvolkov.ru/audio/test.mp3]
<?php //Get images attached to the post $args = array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => -1, 'order' => 'ASC', 'post_status' => null, 'post_parent' => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { $img = wp_get_attachment_thumb_url( $attachment->ID ); break; } //Display image } ?>
Comments are closed.