You don’t need to use echo
with Template Tag, the_tags().
If you want to return the post tags to a variable you can do this:
$tags = wp_get_post_tags($post->ID);
but with $tags I get an Array…since each post has only one tag just to identify that post, how I can get the tag from $tags’s array?.. with $tags[0] it doesn’t return the tag….
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
foreach($tags as $tag) {
echo '<p>' . $title . '<a href="' . get_term_link( $tag, 'post_tag' ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> has ' . $tag->count . ' post(s). </p> ';
}
}
?>
Ah there we go! Thanks a lot MichaelH….
Last question…outside the index.php, in this case in a theme for a plugin, where I adopt the query_posts(…), I get this error:
Use of undefined constant date – assumed ‘date’ in /home/binago/public_html/wp-
content/plugins/mailpress/mp-includes/class/MP_Mail.class.php(247) : eval()’d code at line 17
so I supposed it’s due for this:
$today = getdate();
$args=array(
‘category__not_in’=>array(24,44,127),
‘caller_get_posts’=>1,
‘year’=>$today[“year”],
‘monthnum’=>$today[“mon”],
‘day’=>$today[“mday”]-1,
‘orderby’=>date,
‘order’=>DESC
);
query_posts($args);
precisely in the ‘orderby’=>date maybe outside the usual loop posts doesn’t work…what do you think? is there maybe an alternative for this ‘orderby’=>date?…
Thanks
Luigi
Luigino – please start another topic with that question.