get_the_tags() 返回数组或false 发生故障时。(它似乎还可以返回WP_Error 特定情况下的对象。)
它也requires 一个参数:post ID。您没有传递它,因此无法获得代码所需的数组。
Edit
你不能打电话
get_the_tags() -- 这只会让你得到
false. 你
need 提供职位ID。
这可能会起作用:替换
$asrtags = get_the_tags();
使用
$asrtags = get_the_tags( get_the_ID() );
。。。但请注意,只有当您处于循环中时,这才会起作用。