첫 번째 테마를 만들었지 만 페이지를 업데이트하는 등의 편집 작업에는 적합하지만 게시물을 표시하지는 않습니다.Wordpress "루프"가 내 주제에 블로그 게시물을 표시하지 않습니다.
템플릿 페이지 (twentytwelve 테마에서 복사)에 "루프"를 넣었습니다. 해당 페이지에 게시물 만 나타나기를 원합니다. 블로그 게시물을 설정 페이지의이 페이지에 표시하도록 설정했지만 아무 것도 표시되지 않습니다.
다음은 블로그 게시물을 표시하는 템플릿 페이지의 코드입니다.
어떤 아이디어가 잘못 되었나요? http://imgur.com/izwa5yw을 당신의 블로그 게시물을 표시하려면이 설정이있는 경우 : 당신이 Settings=>Reading
에 "전면 페이지에" 옵션을 변경하지 않는 한
<?php
/**
* Template Name: blog
*
* Full width page template with no sidebar.
*
* @package Myfirsttheme
* @subpackage Template
*/
get_header(); ?>
<?php if (have_posts()) : ?>
<?php /* Start the Loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('content', get_post_format()); ?>
<?php endwhile; ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<div class="entry-content">
<p><?php _e('Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve'); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
<?php endif; // end current_user_can() check ?>
</article><!-- #post-0 -->
<?php endif; // end have_posts() check ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
당신은 ?? 경우 하나 –
이 ENDIF ... 페이지에 page..Go이 템플릿을 할당 나열된 항목에서 선택하는 기본 템플릿을 설정되어! –
이것이 전체 코드라면 php endif가 있기 때문에 빈 페이지가 나타납니다. // end current_user_can() check?>하지만 그것에 대한 if 문은 없습니다. – user850010