<?php
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
echo $curauth[0]->nickname;
?>
我从plugins / dokan-lite / templates / global / product-tab.php复制粘贴上面的代码
到themes / xtocky / template-parts \ author.php
然后显示错误“尝试在C:\ wamp \ www \ wordpress \ wp-content \ themes \ xtocky \ template-parts \ author.php ”中获取非对象的属性/ p>
如何解决错误?