Hello, can someone tell me how to print the current post tags on the screen? It returns the word "array" if I use this:
<?php echo get_tags('orderby=oject_id');?>"
or this
<?php echo get_tags();?>"
What is correct code?
Thank you.
Hello, can someone tell me how to print the current post tags on the screen? It returns the word "array" if I use this:
<?php echo get_tags('orderby=oject_id');?>"
or this
<?php echo get_tags();?>"
What is correct code?
Thank you.
I got it to work by this:
<?php $posttags = get_the_tags($post->ID);
$page_leywords = '';
if ($posttags) {
foreach($posttags as $tag) {
$page_keywords .= $tag->name.',';
}
$page_keywords = substr($page_keywords, 0, -1);
}
?>
Thank you.
So, you wanted the tags in a list but without the links, eh? Okay.
Here's a simpler way:
$posttags = get_the_tags();
foreach($posttags as $tag) { $keywords[] = $tag->name; }
$page_keywords = implode(',',$keywords);This topic has been closed to new replies.