Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using Photospace as a gallery slider within my hatch pro wp theme (you can check here).

The default transition effect between slides is a crossover effect (like this example), but the effect in my slider seems to be image fade to white, then white fades to image. Not sure why this is happening.

Here is the code that calls other scripts:

    /* Enqueue scripts (and related stylesheets) */

add_action( 'wp_enqueue_scripts', 'hatch_pro_scripts' );
function hatch_pro_scripts() {

if ( !is_admin() ) {

    /* Enqueue Scripts */
    wp_enqueue_script( 'hatch_pro_fitvids', get_template_directory_uri() . '/js/fitvids/jquery.fitvids.js', array( 'jquery' ), '1.0', true );


    /* Enqueue Fancybox */
    if ( hybrid_get_setting( 'hatch_pro_fancybox_enable' ) ) {
        wp_enqueue_script( 'hatch_pro_fancybox', get_template_directory_uri() . '/js/fancybox/jquery.fancybox-1.3.4.pack.js', array( 'jquery' ), '1.0', true );     
        wp_enqueue_style( 'hatch_pro_fancybox-stylesheet', get_template_directory_uri() . '/js/fancybox/jquery.fancybox-1.3.4.css', false, 1.0, 'screen' );
        wp_enqueue_script( 'hatch_pro_footer-scripts', get_template_directory_uri() . '/js/footer-scripts.js', array( 'jquery', 'hatch_pro_fitvids', 'hatch_pro_fancybox' ), '1.0', true ); 
    } else {
        wp_enqueue_script( 'hatch_pro_footer-scripts-light', get_template_directory_uri() . '/js/footer-scripts-light.js', array( 'jquery', 'hatch_pro_fitvids' ), '1.0', true );   
    }
}

}

How can I resolve this?

I'm comfortable with CSS, but not so much with PHP or other heavier coding.

share|improve this question
    
I'm not sure there are enough elements in your Question to provide an Answer... If you swap themes, does it work? –  brasofilo Dec 31 '12 at 12:16
    
Thanks brasofilo. Yes, when I swap themes it does work. I also tested it in another site with a different theme and it also works. Someone noted that it also seems that the second image seems to just pop up rather than fade into, so there could be some kind of delay? –  Dave Dec 31 '12 at 16:06
    
For completeness, include the line where the function hatch_pro_scripts is being called as well. Probably, it's a add_action('wp_enqueue_scripts',...); –  brasofilo Dec 31 '12 at 19:26

1 Answer 1

up vote 4 down vote accepted

If the theme was coded using Theme Development Standards, then you can use the function wp_deregister_script to remove conflicting scripts from the page where the slider is being used.


[update]
The original solution (at the bottom) worked in a specific plugin situation (with WP Touch).
I think this is the proper one:

add_action( 'wp_enqueue_scripts', 'wpse_77772_remove_theme_enqueues', 11 );

function wpse_77772_remove_theme_enqueues()
{
    if( is_front_page() || is_home() ) 
    {
        wp_dequeue_script('hatch_pro_fancybox');
        // etc
    }
}

[first version]

For example, in the following snippet I'm removing all the scripts and style of the plugin Alo Easy Mail if the site is being viewed in a mobile device, check comments for your use case.

Put it at the end of the theme's functions.php file (or child theme's).

add_action( 'wp_head', 'wpse_77772_remove_plugin_scripts', 1 );

/**
 * You'd probably want to use
 * if( is_front_page() || is_home() ) 
 *
 * see: http://wordpress.stackexchange.com/q/30385/12615
 */
function wpse_77772_remove_plugin_scripts()
{
    if( wp_is_mobile() ) {
        remove_action('wp_head', 'add_css');
        wp_deregister_script('jqplot');
        wp_deregister_script('bar');
        wp_deregister_script('cax');
        wp_deregister_script('pol');
        wp_deregister_script('fun');
        wp_deregister_script('pie');
        wp_deregister_script('meg');
    }
}

This way, you can remove the conflicting scripts from a specific page, and let them load in the rest.

Search your theme for wp_register_script and grab the handle to use with deregister.

The remove_action works upon all add_action that the theme has.

share|improve this answer
    
I don't see wp_register_script in the theme's functions.php. I do see the following: wp_enqueue_script( 'hatch_pro_fancybox', get_template_directory_uri() So I'd use 'hatch_pro_fancybox', correct? –  Dave Dec 31 '12 at 18:06
    
@Dave, answer updated ;) –  brasofilo Dec 31 '12 at 19:24
    
Thanks for all your help, brasofilo! I really really appreciate it. I've learned a little more now. Too bad, I couldn't figure out the conflict, so I managed to use another slider plugin which worked. Now, I at least know there is a way to deactivate scripts. Still not clear on exactly how that piece of php code works, but I am interested to look into it later. –  Dave Jan 4 '13 at 18:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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