【问题标题】:Can I position the post thumbnail right next to the post in WordPress? (Theming)我可以在 WordPress 中将帖子缩略图放在帖子旁边吗? (主题)
【发布时间】:2020-02-02 12:59:33
【问题描述】:

我正在尝试将我的帖子缩略图放在帖子本身旁边。此外,我想包含一些响应式断点,以便在移动视图中缩略图位于帖子顶部。我想使用引导框架。任何帮助表示赞赏:)

<div class="container-fluid the_loop">
    <div class="col-4">
        <?php while ( $wpb_all_query->have_posts() ) : $wpb_all_query->the_post(); ?>
        <img src="<?php the_post_thumbnail_url("post_image");?>" alt="img-fluid">
    </div>
    <div class="col-8">
        <h2 id="title" href="<?php the_permalink(); ?>">
           <?php the_title(); ?>
        </h2>
        <p id="the_date"><?php the_date(); ?></p>
        <p id="the_content"><?php the_content(); ?></p>
    </div>
</div>

【问题讨论】:

    标签: php html css wordpress twitter-bootstrap


    【解决方案1】:

    有很多方法可以做你想做的事,最好的方法是给内容 div 一个 70% 的宽度,给缩略图 div 一个 30% 的宽度;

    通过这样做,您将确保每个 div 都有自己的宽度,并且它们将彼此并排显示。

    在您的情况下,当您执行移动断点时,缩略图 div 已经在内容 div 上方,因此当您为缩略图提供更宽的宽度时,假设 100% 它将显示在内容上方。

    另一种解决方案是查看this page,它包含您正在搜索的详细信息

    【讨论】:

      猜你喜欢
      • 2011-09-04
      • 2015-07-19
      • 1970-01-01
      • 2011-03-15
      • 1970-01-01
      • 2013-07-17
      • 1970-01-01
      • 1970-01-01
      • 2014-03-12
      相关资源
      最近更新 更多