Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在wordpress中找到类别Id?_Php_Wordpress_Content Management System - Fatal编程技术网

Php 如何在wordpress中找到类别Id?

Php 如何在wordpress中找到类别Id?,php,wordpress,content-management-system,Php,Wordpress,Content Management System,我是wordpress的新手,我需要知道如何找到类别id而不是类别名称? 在wordpress里 任何人都很感激 注册号, vicky你试过了吗 global $wp_query; $cat_ID = get_query_var('cat'); 你试过了吗 global $wp_query; $cat_ID = get_query_var('cat'); 摘自Wordpress法典: 摘自Wordpress抄本:谢谢您的快速回复。此代码用于查找指定类别名称的类别id吗?谢谢您的快速回复

我是wordpress的新手,我需要知道如何找到类别id而不是类别名称? 在wordpress里

任何人都很感激

注册号, vicky你试过了吗

global $wp_query;
$cat_ID = get_query_var('cat');
你试过了吗

global $wp_query;
$cat_ID = get_query_var('cat');

摘自Wordpress法典:



摘自Wordpress抄本:

谢谢您的快速回复。此代码用于查找指定类别名称的类别id吗?谢谢您的快速回复。这段代码是否可以找到指定类别名称的类别id?非常感谢。我期待着向你们学习。再次感谢……非常感谢。我期待着向你们学习。再次感谢,。。。。