이 1. 디스플레이 특정 범주에서 (게시물이나 썸네일) 모든 게시물올바른 서식
용서 페이지 내용 표시에서 페이지 2의 내용에 가장 좋은 방법은 있을까 내 코드가 엉성한 경우. 이렇게하는 것이 더 좋은 방법이라면, 나는 배우려고 매우 열심입니다. 사이트가 완성되면 30 개 이상의 카테고리가있을 것입니다.
<?php get_header(); ?>
<div id="outerWrapper">
<div id="pageContent">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2>
<?php the_title(); ?>
</h2>
<?php the_content(); ?>
<?php endwhile; endif; ?>
<?php query_posts('category_name=cold-casting'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="pages"> <a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a> </div>
<?php endwhile;?>
<div class="clear"></div>
</div>
</div>
<?php query_posts('category_name=casting'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="pages"> <a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a> </div>
<?php endwhile;?>
<div class="clear"></div>
</div>
</div>
<?php get_footer(); ?>
마지막으로 endwhile; 뒤에 wp_reset_query()를 추가하면 원본 쿼리 (현재 페이지를 유지하는 쿼리)와 실행되는 다른 스크립트가 보존됩니다. 코드 (예 : admin bar)가 올바른'$ post' 변수로 작동합니다. –