2
1つのカスタムポストタイプに6つの異なる投稿を追加しました。チームの下には、6人の異なるメンバーがいます。これらの6人のメンバーを2行、各行に3列表示したいのです。それを達成する方法は?私はWordPressのテーマ開発には新しいです。一番最初のページにコードを書き加えようとすると、何か提案やリソースがありがたいです。私が何をしたか はWordPressテーマのカスタムポストタイプからコンテンツを表示する
<section class="team" id="team">
<div class="container">
<div class="row">
<div class="team-heading text-center">
<h2>our team</h2>
<h4>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled</h4></div>
<?php
$args = array(
'post_type' => 'team',
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page' =>3,
);
$the_query = new WP_Query($args);
?>
<?php if($the_query->have_posts()) : ?>
<?php while($the_query->have_posts()) : $the_query->the_post(); ?>
<div class="col-md-2 single-member col-sm-4">
<div class="person">
<img class="img-responsive"> <?php the_post_thumbnail(); ?>
</div>
<div class="person-detail">
<div class="arrow-bottom"></div>
<h3><?php the_title(); ?></h3>
<p><?php the_content(); ?></p>
</div>
</div>
<!-- Query to display +1/next content-->
<div class="col-md-2 single-member col-sm-4">
<div class="person-detail">
<div class="arrow-top"></div>
<h3><?php the_title(); ?></h3>
<p><?php the_content(); ?> </p>
</div>
<div class="person">
<img class="img-responsive"> <?php the_post_thumbnail(); ?>
</div>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php endif ?>
申し訳ありませんが私の問題について明確にすることはできません、私が達成したいのは、最初のテンプレートのタグ - > 'the_title()'と 'the_content()'、私はメンバー1、 'the_title()'と 'the_content()'タグを付けて2番目のメンバに渡します。この問題の他の最良の選択肢を提案すると素晴らしいでしょう – Milan
偶数項目と奇数項目の交互マークアップが必要ですか?私は答えを更新します... – crean