我当前正在使用“echo tag\\u description()”显示标记描述。
有没有其他方法可以让我使用标签slug而不是ID?
我当前正在使用“echo tag\\u description()”显示标记描述。
有没有其他方法可以让我使用标签slug而不是ID?
您需要首先获取标记ID。您可以使用get_term_by()
功能:
$tag = get_term_by( \'slug\', \'tag-slug-here\', \'post_tag\' );
echo tag_description( $tag->term_id );
我有脚本显示类别中的列表标签,效果很好。<ul class=\"inline-list\"> <?php query_posts(\'category_name=lain-lain\'); if (have_posts()) : while (have_posts()) : the_post(); if( get_the_tag_