0
我想根據帖子的Wordpress作者是誰在頁面上顯示不同的圖像。根據帖子作者顯示不同的內容
到目前爲止,我已經嘗試了幾個腳本,但都沒有工作。任何幫助是極大的讚賞。這是我想要做的。
<?php $author = get_the_author(); ?>
<?php
if ($author('author1')) {
echo '
<img src="">;
'
} elseif ($author('author2')) {
echo '
<img src="">;
'
} else {
// if neither, echo something else
}
?>
'如果( $ author =='author1')' –
而一個半冒號或兩個可能不會出錯 – RiggsFolly