Не все картинки отображаются
-
Приветствую!
Подскажите, пожалуйста, почему только одна картинка из трех нормально отображается?
скриншот: http://vfl.ru/fotos/2d30693415375209.html
Суть блока: популярные статьиКод:
<?php setPostViews(get_the_ID()); ?> <div class="single-widget"> <div class="widget popular"> <h2>Популярные посты</h2> <?php $args = array( 'posts_per_page' => 3, 'meta_key' => 'post_views_count', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'category' => '', ); query_posts( $args ); while ( have_posts() ) : the_post(); ?> <div class="media"> <div class="media-left"> <a href="<?php the_permalink(); ?>"><img src=<?php the_post_thumbnail(array(100,100)); ?></a> </div> <div class="media-body"> <h4 class="media-heading"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> <p>Sed ut perspiciatis omnis natus error sit voluptatem accusantium done.</p> </div> </div> <?php endwhile; wp_reset_query(); ?> </div>
В functions:
function setPostViews( $postID ) { $count_key = 'post_views_count'; $count = get_post_meta( $postID, $count_key, true ); if ( $count == '' ) { $count = 0; delete_post_meta( $postID, $count_key ); add_post_meta( $postID, $count_key, '0' ); } else { $count ++; update_post_meta( $postID, $count_key, $count ); } } function getPostViews( $postID ) { $count_key = 'post_views_count'; $count = get_post_meta( $postID, $count_key, true ); if ( $count == '' ) { delete_post_meta( $postID, $count_key ); add_post_meta( $postID, $count_key, '0' ); return "0"; } return $count; }
Просмотр 4 ответов — с 1 по 4 (всего 4)
Просмотр 4 ответов — с 1 по 4 (всего 4)
- Тема «Не все картинки отображаются» закрыта для новых ответов.