0

投稿を3つの列に整理しようとしていますが、機能させることができません。3つの異なる列に3つの投稿を表示したいだけです。

それで

1 | 2 | 3

私がこれまでに持っているもの:

<div id="main-wrapper">

<?php 
  $loop = new WP_Query(array('post_type' => 'camp', 'posts_per_page' => 3)); 
  if ($loop->have_posts()) ?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    <?php   
    $custom = get_post_custom($post->ID);
    $screenshot_url = $custom["screenshot_url"][0];
    $website_url = $custom["website_url"][0];
?>


 <?php the_content(); ?>


<?php endwhile; ?>


</div>

サイトはぼっかい

4

1 に答える 1

0

親内に別のDIVを作成することで簡単に実行できます

<div id="main-wrapper">

<?php 
  $loop = new WP_Query(array('post_type' => 'camp', 'posts_per_page' => 3)); 
  if ($loop->have_posts()) ?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    <div style="float: left;"> <!-- or other class that contains this CSS property, including width etc. -->
      <?php   
        $custom = get_post_custom($post->ID);
        $screenshot_url = $custom["screenshot_url"][0];
        $website_url = $custom["website_url"][0];
      ?>
    </div>


<?php endwhile; ?>


</div>
于 2013-03-01T23:05:56.120 に答える