0

Ok, I have a site using Netgen Gallery and Shopp. I'm trying to deregister the nextgen styles and scripts on the shopp products and pages as there is a conflict. My shopp page title is "Registration" and I'd like to stop any Nextgen stuff from loading on any shopp pages.

Here's the code (that didn't work) that I added to my functions.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');
}
}

Does anyone see what I am missing?

0

Change $post->post_parent == registration to is_page( 'registration' ), and use wp_enqueue_scripts instead of wp_print_scripts/styles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.