나는 내 필요에 맞게 single.php를 편집했으며 작동합니다. 나는 다음과 같이 루프의 일부만 남겼습니다 :워드 프레스 사이드 바 및 루프 PHP 코드가 서로 왜곡합니다
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="entry">
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div>
</div>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
원하는대로 텍스트 만 표시합니다. 템플릿에 세로 막대로 사용할 다음 코드를 추가하면 문제가 발생합니다.
<?php query_posts('showposts=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Link to <?php the_title(); ?>">
<?php the_title(); ?></a><br />
<?php endwhile;?>
마지막 10 개의 게시물의 제목이 표시되어야합니다. 하지만 지금은 루프 또한 permalink에 속한 하나의 게시물 대신 최신 (full0 10 게시물을 표시합니다 ... 나는 변수가 너무 재사용되고 휴식을해야한다고 생각해 .. 참고 single.php 먼저는 '사이드 바'코드를 얻을, 다음은 '루프'코드를 얻을. 그래서
를 워드 프레스는 이런 식으로 행동하는 이유? 워드 프레스는 글로벌 변수의 악몽 미로 때문에
어쩌면, 철저한 설명은 우수한 감사 – DCrystal