1
我需要获取cuurent页面类型。在wordpress中获取当前页面类型
Whene我使用这个func的任何其他功能的作品!
function get_current_page_name(){
if (is_home() || is_front_page())
return 'is_home';
else
return 'is_page';
}
但whene我在主页上使用这样的
function my_function(){
echo get_current_page_name(); /// returns 'is_page'
}
此功能与阿贾克斯
它是AJAX代码 - 这是在functions.php的 –
您需要提供您正在使用的更具体的代码。此处显示的代码运行良好。问题在你的代码中的其他地方。请用你的具体用例来扩展你的问题。 –