I insert author box below my post and use get_the_author to return author name but it doesn't working. It also doesn't working with Search post by author. Hope everyone give me solution, thank in advance.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
echoing worked for the OP, the issue could be related to setting up the post manually, as was in my case. Here is the code:
$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