在购物页面上取消注册NextGen

时间:2014-03-12 作者:mtuttle

好的,我有一个使用Netgen Gallery和Shopp的网站。我正在尝试注销shopp产品和页面上的nextgen样式和脚本,因为存在冲突。我的购物页面标题是“注册”,我想阻止任何下一个东西加载到任何购物页面上。

这是我添加到函数中的代码(不起作用)。php

// NextGEN script exclusions
add_action(\'wp_print_scripts\',\'my_deregister_javascript\', 100);
function my_deregister_javascript(){
if ($post->post_parent == registration) {
    wp_deregister_script(\'ngg_script\');
    wp_deregister_script(\'thickbox\');
}
}

// NextGEN style exclusions
add_action(\'wp_print_styles\',\'my_deregister_styles\', 100);
function my_deregister_styles(){
if ($post->post_parent == registration) {
    wp_deregister_style(\'NextGEN\');
    wp_deregister_style(\'thickbox\');
}
}
有人看到我错过了什么吗?

1 个回复
SO网友:TheDeadMedic

改变$post->post_parent == registrationis_page( \'registration\' ), 和使用wp_enqueue_scripts 而不是wp_print_scripts/styles.

结束

相关推荐