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的 –
您需要提供您正在使用的更具體的代碼。此處顯示的代碼運行良好。問題在你的代碼中的其他地方。請用你的具體用例來擴展你的問題。 –