wordpress - 使用 Bulma 框架的自定义 WordPress 主题,博客卡未正确对齐
问题描述
我正在使用 Bulma CSS 框架制作 WordPress 主题。到目前为止,它运行良好,只是我的博客卡显示不正确。
我需要它们在一行上垂直对齐,它们在我的练习 html 文件中做得很好,但是将它移到 WordPress 上它们彼此重叠。
接受建议,仍在学习 WordPress 的工作原理
目前在 MAMP Pro 服务器上对此进行测试
这是我的代码:
<?php
$args = array(
'post_type' => 'post',
//'posts_per_page' => 2,
);
$blogposts = new WP_Query($args);
while ($blogposts->have_posts()){
$blogposts->the_post();
?>
<section>
<div class="container">
<div class="columns is-multiline is-variable is-4">
<div class="column is-4">
<div class="card">
<div class="card-image"><!--Image container-->
<figure class="image"><!--The Image-->
<img src="<?php echo get_the_post_thumbnail_url(get_the_ID()); ?>"/>
</figure>
</div><!--Close image container-->
<div class="card-content"><!--Container for blog card text-->
<div class="content"><!--blog title, excerpt and link to full article-->
<h3 class="post_title"><?php the_title(); ?></h3>
<p class="excerpt"><?php the_excerpt(); ?></p>
<a class="button" href="<?php the_permalink();?>">Read More</a>
</div><!--close content-->
</div><!--Close card-content-->
</div><!--Close card-->
</div><!--Close column -->
</div><!--Close columns-->
</div>
</section>
<?php } ?><!--close while loop-->
解决方案
设法通过移动来解决它
<?php
$args = array(
'post_type' => 'post',
//'posts_per_page' => 2,
);
$blogposts = new WP_Query($args);
while ($blogposts->have_posts()){
$blogposts->the_post();
?>
成列是-多行...
推荐阅读
- qt - 无法加载 QT 环境
- email - 将故障转移 IP 附加到计算机
- c# - 尝试使用 .NET 生成资产以在 VSCode 中进行构建和调试时出错
- bigcommerce - Big Commerce - 从外部博客页面中提取博客文章
- python - 添加附加信息以请求
- android - 更新 gradle 导致'无法找到方法'com.android.build.gradle.tasks.GenerateBuildConfig.getBuildConfigPackageName()Ljava/lang/String'
- if-statement - 带有 IF 语句的索引匹配公式
- vue.js - vue 过渡而无需使用 v-if / v-show
- ios - Codemagic 未能发布错误:代码 -22020
- python - 烧瓶可以在响应中发送重复的标题吗?