沙唐桔

WordPress 获取当前分类/标签 ID(taxonomy term id)

如题,WordPress 获取当前分类/标签 ID(taxonomy term id),折腾主题可能用得上。

get_queried_object()->term_id;

via:https://stackoverflow.com/questions/12289169/how-do-i-get-current-taxonomy-term-id-on-wordpress