【发布时间】:2017-08-23 10:32:52
【问题描述】:
我使用引导程序,我想在我的 index.php 页面上的两列中显示我的 Wordpress 帖子。我只显示我的帖子的 the_permalink,我希望它们按水平顺序排列。 当页面从 xs 屏幕加载时,我希望将帖子放在一列中,彼此重叠。 我尝试了许多不同的东西,但我无法获得正确的 php 代码。我从头开始,这是我现在拥有的代码:
<?php if (have_posts()): ?>
<div class="container">
<?php while(have_posts()): the_post(); ?>
<div class="row">
<div id="post_title_overview_page">
<div class="col-lg-12 col-md-12 col-xs-12">
<a href="<?php the_permalink(); ?>"><?php $first = str_replace(' | ', '<br />', get_the_title()); echo str_replace('REPLACE_ME', '<i>REPLACE_ME</i>', $first);?></a>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<?php else: ?>
<div class="row">
<div class="col-xs-12">
<p>no result</p>
</div>
</div>
<?php endif; ?>
非常感谢您的帮助!非常感谢!
【问题讨论】:
标签: php wordpress twitter-bootstrap multiple-columns posts