
通过Docker部署运行MariaDB数据库
the_category_id ( $display = true )
the_category_id – 这个函数用来显示分配给一个文章的第一个类别的ID。它对需要知道某个特定文章的类别ID的开发者很有用。
返回或打印一个类别ID。
function the_category_ID($display = true) { _deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' ); // Grab the first cat in the list. $categories = get_the_category(); $cat = $categories[0]->term_id; if ( $display ) echo $cat; return $cat; }