私の問題は、カテゴリ「イベント」からいくつかの投稿を表示していることです。次に、同じページの少し後に、カテゴリ「スピラー」からランダムな投稿を表示したいのですが、それはうまくいきます。ランダムな投稿を取得し、タイトルとサムネイルを表示しますが、show the_content (または the_excerpt) と言うと、カテゴリ「イベント」の投稿のすべてのコンテンツ (または抜粋) を表示します。これを解決するのを手伝ってください!
<div class="well span6 Padding10">
<h4 class="titleFont MarginBottom20">KOMMENDE BEGIVENHEDER</h4>
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array(
'category_name' => 'events', // Change these category SLUGS to suit your use.
'paged' => $paged
);
query_posts( $args ); ?>
<ul>
<?php
while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>"><strong><?php the_title(); ?></strong></a>
</li>
<?php endwhile; ?>
</ul>
</div>
<div class="span6 well" style="height: 250px;"><h4 class="titleFont">SPILLER HIGHLIGHT</h4>
<div class="row-fluid">
<?php
$args = array(
'numberposts' => 1,
'orderby' => 'rand',
'category_name' => 'spiller'
);
$rand_posts = get_posts( $args );
foreach ( $rand_posts as $post ) : ?>
<div class="span5"><?php the_post_thumbnail( array( 150, 150 ) ); ?></div>
<div class="span6 MarginTop10">
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<!-- THIS IS WHERE IT MESSES UP: --><?php the_content(); ?>
</div>
<?php endforeach; ?>
</div>
</div>