테마를 만드는 중입니다. 작성자가 single.php 페이지에 표시되도록 할 수 없습니다. 사이트의 하단에 표시되지만 헤드 라인의 첫 번째 통화에는 표시되지 않습니다.작성자가 single.php에 표시되지 않습니다
<header class="intro-header" style="background-image: url('http://i.imgur.com/ZyZMhQv.jpg')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1><?php the_title(); ?></h1>
<hr class="small">
<span class="subheading">Posted by <?php the_author(); ?> on <?php the_time('F jS, Y'); ?></span>
<div id="avatar" class="row text-center"><?php echo get_avatar($post->post_author, 92); ?> </div>
</div>
</div>
</div>
</div>
</header>
두 번째로 루프 내에서 호출되면 정상적으로 작동합니다.
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default panel-body">
<?php while(have_posts()) : the_post(); ?>
<p> Posted by <?php the_author(); ?> on <?php the_time('F jS, Y'); ?> </p>
<p> <?php the_content(''); ?> </p>
<?php endwhile; wp_reset_query(); ?>
</div>
</div>
처음으로 전화를 걸면 왜 표시되지 않습니까?
나는 WP 전문가가 아니지만'echo the_author();'와'echo $ post-> post_author;'의 차이점은 무엇입니까? 만약'the_author()'가'have_posts()'를 반복 할 때만 반환 될 것이라고 추측해야한다면, – MonkeyZeus
이 작동하는지 확실하지 않습니다.- the_author (get_the_ID()); – Neil