虽然echoing
为OP工作,问题可能与手动设置职位有关,就像我的情况一样。代码如下:
$post = get_post();
setup_postdata($post); // setting up the post manually
// Then you can fetch/echo the author name
var $authorName = get_the_author();
var $content = get_the_content(); // This works too