【发布时间】:2015-07-15 09:49:11
【问题描述】:
我的 Wordpress 网站显示所有帖子,这些帖子在 index.php 上使用行(引导 3)堆叠在跨越整个宽度的文章中。
index.php - HTML
<div>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
get_template_part( 'content' );
?>
<?php endwhile; ?>
<div class="clearfix"></div>
<div class="col-md-12">
</div>
<?php else : ?>
<?php get_template_part( 'no-results', 'index' ); ?>
<?php endif; ?>
</div>
content.php 显示每篇文章中的帖子(彼此堆叠,全宽,页面下方)
<article id="post-<?php the_ID(); ?>" <?php post_class('container-fluid'); ?>>
<div class="row">
<div class="col-md-12 horiz-cell">
<h2><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php the_category(', '); ?>
</div>
</div>
</article><!-- /#post -->
我在每一行中都正确显示了标题和类别。我希望每个帖子的后缩略图(我在functions.php中添加了它的使用)作为每行的背景图像。填满整个空间(背景大小:封面)
基本上是大的,“100% 宽度”和“300 像素(大约)高度”的行,每行都有相应的标题、类别及其作为背景图像的后缩略图。
【问题讨论】:
标签: php jquery html css wordpress