Войти

Показать полную графическую версию : Wordpress, вывод картинок


veter48
10-01-2013, 18:28
Здравствуйте, нужна помощь по wordpress, нужно при выводе постов выводить и маленькую картинку , пробую так, в functions.php прописываю:
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' ); } //Adds thumbnails compatibility to the theme
set_post_thumbnail_size( 152, 113, true );
И вывод происходит так:
<div id="teaser">
<div class="post-title"><div class="title-text"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></div></a></div>
<div class="exc">
<div class="post-img"><?php the_post_thumbnail(); ?></div>
<div class="post-text">
<?php the_excerpt(); ?>
</div>
</div>
<?php
if( get_the_time( "Y.m.d" ) == date( "Y.m.d" ) ) $postDateFormat = "G:i";
else $postDateFormat = "Y.m.d";
?>
<div class="post-footer">
<div class="post-date"><?php the_time( $postDateFormat ); ?></div> <div class="post-comments"> <a href="<?php the_permalink(); ?>#comments">Comments (<?php comments_number("0","1","%"); ?>)</a></div> <div class="post-read-more"><a href="<?php the_permalink(); ?>">Read more</a></div>
</div>
</div>
Но картинка не появляется, функция the_post_thumbnail(); ничего не выводит.
Подскажите, пожалуйста.

veter48
14-01-2013, 17:37
Неужели с этим никто не сталкивался?




© OSzone.net 2001-2012