【问题标题】:Wordpress grid shows empty entriesWordpress 网格显示空条目
【发布时间】:2018-05-28 11:15:27
【问题描述】:

我在 wordpress 中创建了一个网格。但有时我会得到空条目。 enter image description here

<div class="row">
    <?php

    if ( have_posts() ) {
        while ( have_posts() ) : the_post();

              ?>

                  <div class="col-md-4">
                    <?php $kale_entry = 'small'; include(locate_template('parts/entry.php')); ?>
                  </div>
                <?php
        endwhile;

    }?>

您有什么想法,为什么会这样?提前谢谢了!

【问题讨论】:

  • 到目前为止你尝试过什么?这些尝试的结果是什么?
  • stackoverflow 还是新手。这是我的代码:
  • 这是一个样式问题,因为第一列的高度与另一列的高度不同,所以它浮动到右侧。
  • 为此 div 设置 min-height:500px col-md-4
  • 谢谢 PrakashSingh,@George,但它没有起到作用。

标签: php wordpress


【解决方案1】:

为此 div 'col-md-4' 设置 'min-height:600px'。增加最小高度并检查。

【讨论】:

    猜你喜欢
    相关资源
    最近更新 更多
    热门标签