簡體   English   中英

Twitter引導縮略圖不並排

[英]Twitter bootstrap thumbnail are not side by side

    <article <?php post_class(); ?>>
      <header>
        <div class="container">
         <div class="row">
            <div class="col-sm-6 col-md-3">
             <div class="thumbnail">
                <?php if(has_post_thumbnail()) : ?>
                     <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                    <?php the_post_thumbnail(); ?>
                       </a>
                  <?php endif; ?>
                <div class="caption">
                     <h3 class="thumbnail-label"><a class="" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                    <?php get_template_part('templates/entry-meta'); ?>
                     <div class="entry-summary">
                    <?php the_excerpt(); ?>
                      </div>
      </header>
                </div>
              </div>
            </div>
          </div>
        </div>
    </article>

即時通訊有麻煩讓它們並排對齊。 他們所做的只是彼此疊放,我似乎無法讓它們並排。

這是它看起來像http://getbootstrap.com/components/#thumbnails的樣子

您似乎太早關閉<header>標記。 請嘗試以下標記:

<article <?php post_class(); ?>>
    <header>
        <div class="container">
            <div class="row">
                <div class="col-sm-6 col-md-3">
                    <!-- Your thumbnail code goes here. -->
                </div>
            </div>
        </div>
    </header>
</article>

注意:如果在循環中使用此代碼,則可以解釋為什么縮略圖會堆疊。

假設<article>標記包含已循環的元素,則循環的內容過多。 您的標記應為:

{outside_element}
    {loop}
        {looped_element}
    {/loop}
{/outside_element}

通過3次迭代運行此命令將為您提供:

{outside_element}
    {looped_element}
    {looped_element}
    {looped_element}        
{/outside_element}

現在您會得到:

{outside_element}
    {looped_element}        
{/outside_element}
{outside_element}
    {looped_element}        
{/outside_element}
{outside_element}
    {looped_element}        
{/outside_element}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM