2013-02-20 3 views
0

Я пытаюсь найти решение, как отображать только изображение миниатюр на главной странице блога, а внутри сообщения отображаются все остальные изображения, прикрепленные к сообщению.Wordpress image Thumbnail

Я искал его без везения ... Может ли кто-нибудь помочь?

Здесь вы можете увидеть, что я имею в виду: blog.turdidesigns.com

Я новичок в WordPress, так что я appologise, если это глупый вопрос.

Спасибо,

ответ

0

в файле index.php заменить the_content(); с the_excerpt();

Кроме того, это может быть в цикле, поэтому обязательно замените это для списков статей (категория, архив, поиск), а не в одном цикле.

+0

, то вы должны изменить content.php –

0

в указательного PHP я не это ...

Вот что у меня есть: в моей теме папки infex PHP У меня есть только это:

<?php get_header(); ?> 

<div class="art-layout-wrapper"> 

    <div class="art-content-layout"> 

     <div class="art-content-layout-row"> 

      <div class="art-layout-cell art-content"> 

      <?php get_sidebar('top'); ?> 

      <?php 

       if(have_posts()) { 



        /* Display navigation to next/previous pages when applicable */ 

        if (theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation')) { 

         theme_page_navigation(); 

        } 



        /* Start the Loop */ 

        while (have_posts()) { 

         the_post(); 

         get_template_part('content', get_post_format()); 

        } 



        /* Display navigation to next/previous pages when applicable */ 

        if (theme_get_option('theme_bottom_posts_navigation')) { 

         theme_page_navigation(); 

        } 



       } else { 



        theme_404_content(); 



       } 

      ?> 

      <?php get_sidebar('bottom'); ?> 

       <div class="cleared"></div> 

      </div> 

      <div class="art-layout-cell art-sidebar1"> 

       <?php get_sidebar('default'); ?> 

       <div class="cleared"></div> 

      </div> 

     </div> 

    </div> 

</div> 

<div class="cleared"></div> 

<?php get_footer(); ?> 

Я сделал эту тему с Artisteer, поэтому не судите меня слишком много;)

+0

, если вы можете показать нам, что происходит на get_template_part ('содержание', get_post_format()); может быть, мы можем вам помочь. файл должен иметь имя типа content-post.php или content-index.php – EmptySpaces

+0

У меня есть 3 файла, content.php, content-page.php и content-single.php, которые вы хотели бы увидеть? –

+0

let see content.php – EmptySpaces

0

Извините за поздний ответ !!!

Вот код content.php:

<?php 



/** 

* 

* content*.php 

* 

* The post format template. You can change the structure of your posts or add/remove post elements here. 

* 

* 'id' - post id 

* 'class' - post class 

* 'thumbnail' - post icon 

* 'title' - post title 

* 'before' - post header metadata 

* 'content' - post content 

* 'after' - post footer metadata 

* 

* To create a new custom post format template you must create a file "content-YourTemplateName.php" 

* Then copy the contents of the existing content.php into your file and edit it the way you want. 

* 

* Change an existing get_template_part() function as follows: 

* get_template_part('content', 'YourTemplateName'); 

* 

*/ 



    global $post; 

    theme_post_wrapper(

     array(

       'id' => theme_get_post_id(), 

       'class' => theme_get_post_class(), 

       'thumbnail' => theme_get_post_thumbnail(), 

       'title' => '<a href="' . get_permalink($post->ID) . '" rel="bookmark" title="' . strip_tags(get_the_title()) . '">' . get_the_title() . '</a>', 

     'heading' => theme_get_option('theme_'.(is_single()?'single':'posts').'_article_title_tag'), 

       'before' => theme_get_metadata_icons('date,author,edit', 'header'), 

       'content' => theme_get_excerpt(), 

       'after' => theme_get_metadata_icons('category,tag,comments', 'footer') 

     ) 

    ); 

?>