我正在努力复制下面的wordpress图片。问题是我不知道怎么做。
我有这个代码来控制特征图像的大小。
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 400, 300, true );
add_image_size( 'post-thumbnails', 400, 300, true );这个代码的问题是它只负责一大小,只有400x300。其他人呢?如果你看下面的图片,我相信你能看到至少3个大小(3个变体)?
我在Index.php文件中的Wordpress代码简单明了:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<h1><a href="<?php the_permalink() ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
<?php the_post_thumbnail('post-thumbnail', array( 'id' => "FeaturedImage")); ?>
<?php the_excerpt(); ?>
<?php endwhile; ?>
<?php else : ?>
<h2>You're Lost! </h2>
<?php endif; ?>我想听听您对此如何实现html/css代码结构的意见。

发布于 2014-03-28 14:28:42
为什么不使用add_image_size来添加更大的大小呢?
add_image_size( 'another-thumbnails', 150, 300, true );
add_image_size( 'another2-thumbnails', 300, 150, true );您也可以使用砖石http://masonry.desandro.com/ (js库)来满足您的需要,它将安排块很好地显示。
另一种方法是使用tim拇指(php http://timthumb.googlecode.com/svn/trunk/timthumb.php)动态生成裁剪的图像(不需要在每个上传文件上生成多个大小)。
在你的例子中有两件事:
https://stackoverflow.com/questions/22658471
复制相似问题