我想顯示一個特定類別的帖子作爲三列布局我有的問題是我不知道如何使用或forwach循環顯示每個發佈縮略圖,以便它可以使用one_thrid_last。 css類。獲得在wordpress中的縮略圖圖像和在3 coulmn中顯示
<?php while (have_posts()) : the_post(); ?>
<?php if (is_category('actress-gallery')):?>
<?php if (function_exists("has_post_thumbnail") && has_post_thumbnail()) : ?>
<div class="one_fourth_last">
<a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0')); ?>" rel="bookmark">
<?php echo $image_url = wp_get_attachment_image(get_post_thumbnail_id($post->ID) , 'thumbnail'); ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
</a>
</div><!-- post-thumbnail /-->
<?php endif; ?>
did not get you question? – codepixlabs
上面的代碼將按照垂直順序顯示該類別的所有帖子的縮略圖,我想要的是將圖像顯示爲每行3個圖像...就像一個網格...謝謝 – akkarthe
表示在第一個顯示3個圖像行,然後轉移到下一行?等等 ? – codepixlabs