<?php while (have_posts()) : the_post(); ?>
<section class="panel panel-white">
<div class="row single-post-content">
<?php if ($category_name !== 'Jobs') { ?>
<h5 class="author-post__title"><?php the_author() ?></h5>
<p><?php echo get_the_date(); ?></p>
<?php }
the_content();
if ($category_name !== 'Jobs') { ?>
<div class="row author-post">
<div class="small-12 medium-4 column">
<img src="<?php echo get_avatar(); ?>" alt="" />
</div>
<div class="small-12 medium-8 column">
<h5 class="author-post__title"><?php the_author() ?></h5>
<p>
Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s, when an unknown printer took a
galley of type and scrambled it to make a type specimen
book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s
with the release of Letraset sheets containing.
</p>
</div>
</div>
<?php } ?>
</div>
</section>
<?php endwhile;?>
我試圖通過撰寫帖子的作者的頭像。 我認爲這會使這項工作,但它似乎並沒有輸出正確的網址,並給了我一個404圖像。WordPress的 - 獲取作者圖片
其他人通過頭像圖像做了什麼方法?
我正在尋找一個答案,告訴我如何做到這一點,如果沒有圖像不顯示一個。
UPDATE:
我曾嘗試使用下面的代碼,使這項工作:我要指出,我試圖讓我的本地機器上的這項工作爲好。
echo get_avatar($authorId, 100);
(變量使用get_the_author_id()
)
我已經添加了一個更新我的問題 –