php - 尝试使用 bootstrap 和 wordpress 创建 3 列
问题描述
我正在尝试使用引导程序和 Wordpress 创建 3 列。我希望我的类别帖子分为 3 列。但是,当我查看类别页面时,它们不是 3 列,而是在一列中,彼此堆叠。我究竟做错了什么?这是我的archive.php 模板
<?php if(have_posts() ): while(have_posts()): the_post();?>
<div class="container">
<div class="row">
<div class="col-md-4 post-card">
<?php if(has_post_thumbnail()):?>
<a href="<?php the_permalink();?>"><img src="<?php the_post_thumbnail_url('blog-small');?>" alt="<?php the_title();?>" class="img-fluid mb-3 img-thumbnail">
<?php endif;?>
<a href="<?php the_permalink();?>"><h2 class="h2 text-center mb-3"><?php the_title();?></h2>
<a href="<?php the_permalink();?>" class="btn btn-success">Read more</a>
</div>
</div> </div>
解决方案
推荐阅读
- hue - 在 Hue 源代码中的 HiveServerClient 中获取当前编辑器 id(doc id)的方法
- node.js - 在 Passanger 上运行 React 应用程序
- java - 我如何使用简单的日期格式知道我的日期在 java 中是否有效?
- swift - 打开自定义表格视图单元格不会保持突出显示
- javascript - JS/IE11中的DispHTMLWindow2和Window有什么区别?
- c - 调用自制C函数时出现分段错误
- angular - 使用内置管道的角度条件
- spring - Spring Boot 运行失败
- python - 在python中有些句子存储在双引号中,有些句子存储在csv文件中
- php - 使用 mysqli 插入重复条目的验证不起作用