21のindex.phpファイルで以下のコードを使用しています
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php query_posts('cat=4&showposts='.get_option('posts_per_page')); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="post-thumb-title">
<a href="<?php the_permalink() ?>"><?php the_post_thumbnail(array(632,305));?></a>
<p class="thumb-title"><?php the_title(); ?></p>
</div>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
上記のコードからわかるように、Cat ID = 4の投稿のみを表示しており、cssを使用して、カスタムサイズの関数「the_post_thumbnail」を使用して生成された画像サムネイルにタイトルをオーバーレイしています。問題は、フロントページに投稿のタイトルと最初の投稿のサムネイルのみが表示されていることです。
あなたはここでウェブサイトを見ることができます:http://fusion.fusionconstruction.co.uk/
カテゴリID4が選択されている他の投稿へのリンク:
http://fusion.fusionconstruction.co.uk/fusion-media-at-revolution-round-1/
http://fusion.fusionconstruction.co.uk/fusion-launch-new-website-for-dean-downing/
1回目と同様の投稿をすべて表示したいと思います。
ありがとう!