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