내가했던 나의 홈 페이지에 하나의 게시물을 표시하려면 다음Wordpress를 작성하는 방법은 의견과 의견 양식이있는 첫 페이지에 단 하나의 게시물 만 표시 하시겠습니까?
home.php :
<?php
get_header();
query_posts('posts_per_page=1'); //returns only the front page
?>
<div id="content">
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
get_template_part('loop', 'index');
?>
</div>
<div id="sidebar">
<?php get_sidebar(); ?>
</div>
<div id="footer">
<?php get_footer(); ?>
하지만 난 여전히 의견과 양식을보기 위해 Comments
을 클릭 ahave 코멘트를 남겨주세요. 즉시 자동으로 표시 할 수 있습니까?
죄송합니다. #content div 바로 앞에 해당 코드를 삽입했는데 아무 일도 없었습니다! – alexchenco
루프를로드하기 전에 주석을 표시하려면'the_post()'를 호출하고 주석을로드 한 다음'rewind_posts()'를 사용하여 루프를 재설정하십시오. – TheDeadMedic