-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