이 템플릿을 사용하여 사용자 지정 템플릿을 만들고 페이지를 추가했습니다. 하지만 루프가 제대로 작동하지 않습니다. 루프는 페이지 ID가있는 기사를 반환합니다 (분명히 존재하지는 않습니다). 누구나 그것에 대해 조언을 해줄 수 있습니까?Wordpress. 템플릿 파일에서 루프가 작동하지 않습니다.
Header.php 내가 내 사용자 지정 템플릿에 사용 (루프는이 헤더의 index.php에 올바른 작동) :
<?php while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-conten clr">
<?php the_content(); ?>
<?php wp_link_pages(array('before' => '<div class="page-links clr">', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); ?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php edit_post_link(__('Edit Page', 'wpex'), '<span class="edit-link">', '</span>'); ?>
</footer><!-- .entry-footer -->
</article><!-- #post -->
<?php comments_template(); ?>
<?php endwhile; ?>
희망 :
<head>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/styles.css" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/ptsans.css" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/ptserif.css" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/css/neucha.css" />
<script type="text/javascript"></script>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' |'; } ?> <?php bloginfo('name'); ?></title>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_head(); ?>
루프가 기본 너무 누군가 내가 잘못하고있는 것을 설명 할 수 있습니다.
어디서나 wp_footer()를 호출하고 있습니까? 그리고 당신은 정말로 wss_enqueue_style을 CSS 상단의 include에 붙여 넣는 대신 사용해야합니다. –
답장을 보내 주셔서 감사합니다. 지금부터 wp_enqueue_style을 사용하겠습니다. 예,이 페이지에서 wp_footer()를 사용하고 있습니다. – user1820686