WordPress의 ID로 맞춤 게시물을 받고 해당 미리보기 이미지, 제목 및 콘텐츠를 어떻게 표시합니까? 여기에 제가 사용하고있는 것이 있지만 내용이 엉망입니다.ID (WordPress)로 게시물 가져 오기
<div class="left-cont1">
<div class="left-cont1-text">
<?php
query_posts('post_id=790&post_type=homepage');
while (have_posts()): the_post();
?>
<h1><?php the_title(); ?></h1>
<div class="cont1-border"></div>
<p><?php echo(types_render_field("homepage-content", array("raw"=>"true"))); ?></p>
<h2><a href="<?php the_permalink();?>/more/"><?php echo(types_render_field("homepage-urltitle", array("raw"=>"true"))); ?></a></h2>
</div>
<div class="left-cont1-image1"><?php echo get_the_post_thumbnail($page->ID, 'home-circle'); ?></div>
<?php endwhile;?>
</div>
감사
"콘텐츠가 엉망입니다"라는 의미는 무엇입니까? 그것은 틀린 포스트, 아무것도, 또는 ...에서 끌어 당기고 있는가? – Andrew
안녕하세요, 앤드류. 동일한 축소판, 게시물 등을 여러 번 페이지에 표시하는 것처럼 모든 것이 반복됩니다. 나는 단지 4 개의 게시물을 보여주고 싶었다. – FlourishDNA
게시 한 코드에서 ID가 790 인 단일 게시물 만 가져옵니다. 즉, 이후의 모든 루프는 해당 게시물 만 가져옵니다. 또한'$ page-> ID'는 현재 루프에있는 게시물의 ID를 얻지 못합니다. 원한다면'get_the_ID()'를 사용하십시오. – Andrew