-1
我正在使用wp_footer
操作在網站頂部顯示條形。
我使用is_customize_preview()
並獲取定製器URL中的條形碼id,它不返回任何東西。
下面是我的代碼:
add_action('wp_footer', 'jws_ob_content');
function jws_ob_content() {
if(is_customize_preview()) {
$offer = get_post($_GET['offer_id']);
$offer_custom = get_post_custom($_GET['offer_id']);
echo "<pre>";
print_r($_GET['offer_id']);
exit();
}
else {
$offer = get_post('505');
$offer_custom = get_post_custom('505');
}
}
'is_customize_preview()'方法做什麼? – Peon
is_customize_preview()如果是定製程序,則返回true。 –
檢查'print_r($ _ REQUEST);'? – C2486