attachment vs. “миниатюра”

Здравствуйте. Использую следующий код для вставки аттачей к посту:

                        <?php 
                        global $post;
                        $args = array(
                            'post_type' => 'attachment',
                            'numberposts' => null,
                            'post_status' => null,
                            'post_parent' => $post->ID
                        ); 
                        $attachments = get_posts($args);
                        if ($attachments) {
                            foreach ($attachments as $attachment) {
                                //echo apply_filters('the_title', $attachment->post_title);
                                the_attachment_link($attachment->ID, false);
                                
                                $buffer = filesize( get_attached_file( $attachment->ID ) ) / 1000;
                                $intbuffer = (int)$buffer;
                                Echo "<br>($intbuffer Kb)";
                            }
                        }                        
                        ?>

В результате туда же лепится "миниатюрка" к этому же посту. Меня это очень не радует. Можно ли как-то ее отследить, и не выводить в списке прикрепленных файлов?

И еще, можно ли чтоб у меня все ссылки на аттачи были текстовыми? А то на картинки у меня показывает ссылку-картинку.

Возможно есть другие методы, с удовольствием их выслушаю.

Спасибо.

Нашел решение такое:

                        <?php 
                        // get all of the images attached to the current post
                        
                            global $post;

                            $photos = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'application,text', 'order' => 'ASC', 'orderby' => 'guid') );

                            if ($photos) {
                            echo "<h2 class='title'>Файлы для скачивания</h2>";
                                foreach ($photos as $photo) {
                                    echo "<p><a href='".$photo->guid."' class='".$photo->post_mime_type."'>".$photo->post_title."</a></p>";
                                }
                            }
                        ?>
Anonymous
Отправить
Ответ на: