在我正在处理的主题上,我想要一个div,它可以扩展到外部div的100%高度(我会放在缩略图周围)。这样做的目的是将文本进一步向右移动,以对齐为块段落,而不是环绕缩略图。我会使用填充,但我希望摘录的文本在没有图像时向左对齐。我试过几次,都没用。建议?
看一看:http://themeforward.com/demo2/page/2/
如果我使用else语句(http://codex.wordpress.org/Function_Reference/has_post_thumbnail ) 我需要在其中添加整个摘录,这似乎有些草率。
我的代码:
<?php get_header(); ?>
<div id="container">
<div id="main_index">
<div class="main_adjust">
<!-- Grab posts -->
<?php while (have_posts()) : the_post(); ?>
<!-- Begin excerpt wrap -->
<div class="excerpt_wrap">
<div class="excerpt_inside">
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<span class="sub-title">By <?php the_author_posts_link( ); ?> <span class="sub-title-divider">|</span> <?php the_time(\'F j, Y\'); ?> <span class="sub-title-divider">|</span> <a href="#commentlist"><?php comments_number( \'No comments\', \'One comment\', \'% comments\' ); ?></a></span>
<?php the_excerpt(); ?>
<!-- End excerpt wrap -->
</div>
</div>
<?php endwhile; ?>
<!-- Next/Previous entries -->
<div class="mp_archive">
<div id="more_posts">
<div class="oe"><?php next_posts_link(\'« Older\') ?></div><div class="re"><?php previous_posts_link (\'Newer »\') ?></div>
</div>
</div>
</div>
</div>
<?php get_sidebar(); ?>
</div>
</div>
<?php get_footer(); ?>