jQuery accordion plugin won’t work once used in WP

You seem to still be having issues, what i’d do to avoid having all that code clutter the header is setup a bunch of enqueues, but handle the html5 js inside the print scripts action along with the appropriate conditional comments(there’s no proper way to do this with the enqueue system).

First the HTML5 js, outright just print the conditional logic and script tag(it’s an appropriate action for this kind of thing).

add_action( 'wp_print_scripts', 'do_print_html5js' );

function do_print_html5js() {
    echo '<!--[if lt IE 9]>' . "\n";
    echo '<script type="text/javascript" src="'.get_stylesheet_directory_uri().'/js/html5.js"></script>' . "\n";
    echo '<![endif]-->' . "\n";
}

Notes: Although to be honest, the above part isn’t necessary at all and you could leave it in the header file, the TwentyThirteen theme just does that, i’d just personally avoid the extra clutter.

Then fire off your enqueues for the accordian, using the dependencies parameter to indicate to each script what other script or scripts it depends upon. I referenced the internal jQuery to, there’s no need to fetch that externally.

add_action( 'wp_enqueue_scripts', 'register_and_enqueue_scripts' );

function register_and_enqueue_scripts() {
    wp_enqueue_script( 'jquery-easing', 'http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js', array('jquery'), false );
    wp_enqueue_script( 'jquery-zaccordian', get_stylesheet_directory_uri() . '/js/jquery.zaccordion.js', array( 'jquery-easing'), false );
    wp_enqueue_script( 'my-zaccordian', get_stylesheet_directory_uri() . '/js/myaccordion.js', array('jquery-zaccordian'), false );
    wp_enqueue_style( 'slidemenucss', get_stylesheet_directory_uri() . '/css/slidemenu.css', array(), false );
}

Move your jQuery code that creates the accordian into a seperate file, and adjust the file name in the above enqueue, myaccordion.js as needed.

I tested the above code before posting this answer, here’s the test HTML code i plonked in my header.php file and the jQuery used to create the accordian.

header.php – html (just the important bit)

<ol id="example1">
    <li><img src="https://wordpress.stackexchange.com/questions/97466/<?php echo get_stylesheet_directory_uri(); ?>/images/myimage.png" alt="" /></li>
    <li><img src="https://wordpress.stackexchange.com/questions/97466/<?php echo get_stylesheet_directory_uri(); ?>/images/myimage.png" alt="" /></li>
    <li><img src="https://wordpress.stackexchange.com/questions/97466/<?php echo get_stylesheet_directory_uri(); ?>/images/myimage.png" alt="" /></li>
    <li><img src="https://wordpress.stackexchange.com/questions/97466/<?php echo get_stylesheet_directory_uri(); ?>/images/myimage.png" alt="" /></li>
</ol>

myaccordion.js

jQuery(document).ready(function($) {
    $("#example1").zAccordion({
        easing: "easeOutBounce",
        height: "150px",
        slideWidth: "600px",
        width: "900px"
    });
});

Hope that helps and keeps your header file a little cleaner.. 😉