0

So I made a "Custom Post Type" for Wordpress and also made a single-*.php (single-yourcustomtype.php) for content-display.

Code from single-*.php:

<?php $author = get_the_author(); echo $author; ?>

It works in the content.php, but not in the single-*.php...

Any idea why is it not working or how can I display out author's name?

Thanks in advance.

4

1 回答 1

0

您是否尝试过添加全局 $post;

于 2013-06-19T12:51:11.073 回答