Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.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/13.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:如何获取当前页面的名称_Php_Wordpress - Fatal编程技术网

Php Wordpress:如何获取当前页面的名称

Php Wordpress:如何获取当前页面的名称,php,wordpress,Php,Wordpress,如果我当前的url是www.example.com/thank-you,我如何以wordpress方式呼出页面名称。wordpress方式: echo $post->post_name; 正常方式:(也应在WP中工作) 我怀疑$\u服务器['PHP\u SELF']将返回任何看起来像www.example.com/thank-you或/thank-you echo $_SERVER['PHP_SELF'];

如果我当前的url是www.example.com/thank-you,我如何以wordpress方式呼出页面名称。

wordpress方式:

echo $post->post_name;
正常方式:(也应在WP中工作)


我怀疑
$\u服务器['PHP\u SELF']
将返回任何看起来像
www.example.com/thank-you
/thank-you
echo  $_SERVER['PHP_SELF'];