admin管理员组文章数量:1315017
I am making themes of WordPress. The cards I create with Bootstrap normally need to be side by side, but they come at the block element level. What should I do to keep blog posts side by side?
<div class="container mt-5">
<h3><?php bloginfo("name"); ?></h3>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="card-group" >
<div class="card" >
<div class="card-body" >
<?php the_title( '<h5 class="card-title">', '</h5>' ); ?>
<p class="card-text"><?php the_excerpt(); ?></p>
<a class="btn btn-info" href="<?php the_permalink(); ?>">Devamını Oku</a>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div>
I am making themes of WordPress. The cards I create with Bootstrap normally need to be side by side, but they come at the block element level. What should I do to keep blog posts side by side?
<div class="container mt-5">
<h3><?php bloginfo("name"); ?></h3>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="card-group" >
<div class="card" >
<div class="card-body" >
<?php the_title( '<h5 class="card-title">', '</h5>' ); ?>
<p class="card-text"><?php the_excerpt(); ?></p>
<a class="btn btn-info" href="<?php the_permalink(); ?>">Devamını Oku</a>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div>
Share
Improve this question
edited Nov 21, 2020 at 18:34
fuxia♦
107k38 gold badges255 silver badges459 bronze badges
asked Nov 21, 2020 at 18:17
Bodom NCQBodom NCQ
1
1 Answer
Reset to default 1That's because you are creating a card group in each iteration of the loop.
You should move the <div class="card-group" >
div out of the loop.
本文标签: designCustom Blog Posts do not come side by side in WordPress
版权声明:本文标题:design - Custom Blog Posts do not come side by side in WordPress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741974189a2408021.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论