php& wordpress - 显示完整的图像而不是缩略图?

时间:2012-04-18 13:19:02

标签: php image wordpress thumbnails

我正在使用它在我的wordpress博客上显示图像 -

功能:

add_theme_support( 'post-thumbnails' );  
set_post_thumbnail_size( 590, 275, true ); // 590 pixels wide by 275 pixels tall, hard crop mode

指数:

<div class="post-wrap">
      <?php the_post_thumbnail(); ?>
      <?php the_excerpt(__('keep reading', 'grisaille')); ?></div>
      <?php wp_link_pages(
                array(  'before'           => '<p class="pages-links">' . __('Pages:', 'grisaille'),
                        'after'            => '</p>',
                        'next_or_number'   => 'number',
                        'nextpagelink'     => __('Next page', 'grisaille'),
                        'previouspagelink' => __('Previous page', 'grisaille'),
                        'pagelink'         => '%')); ?>
      <p class="postMeta"><small><?php _e('Category', 'grisaille'); ?> <?php the_category(', ') ?> | <?php _e('Tags', 'grisaille'); ?>: <?php the_tags(' '); ?></small></p>

      <hr class="noCss" />
    </li>

    <?php comments_template(); // Get wp-comments.php template ?>

    <?php endwhile; ?>

我想展示完整的图像,而不是显示缩略图。我该如何做到这一点?

3 个答案:

答案 0 :(得分:3)

替换它:

 <?php the_post_thumbnail(); ?>

......用这个:

 <?php the_post_thumbnail( 'full' ); ?>

答案 1 :(得分:1)

使用此功能:

wp_get_attachment_image(get_post_thumbnail_id(get_post(get_the_ID()),'full',0,array('title' => '' ));

Check this link

答案 2 :(得分:1)

WordPress核心内置了四种有效的大小。

the_post_thumbnail('thumbnail');       // Thumbnail (default 150px x 150px max)
the_post_thumbnail('medium');          // Medium resolution (default 300px x 300px max)
the_post_thumbnail('large');           // Large resolution (default 640px x 640px max)
the_post_thumbnail('full');            // Original image resolution (unmodified)

最后一个是你正在寻找的。

相关问题