Support » How-To and Troubleshooting » Calling WP_Query does return a Post, but not the Tags
7 years, 9 months ago
My index.php looks like this (irrelevant HTML skipped):
$myPosts = new WP_Query('category_name=xxxxxx&showposts=3&order=DESC');
print "<h1>" . get_the_title() . "</h1>";
print get_the_tags('<p class="tags"><strong>Tags: </strong>', ' | ', '</p>');
My problem is that the title is returned, but the tags are not.
I have read the file query.php but cannot find a clue where to look for a solution. I hope this is not too much a newbie question.
Thanks for your help.
because get_the_tags returns an array.
please read this : http://codex.wordpress.org/Template_Tags/get_the_tags