jQuery selectmenu wordpress

I am moving a site from normal php to wordpress and currently they use jquery-selectmenu plugin for their select menus.

I have tried to enqueu the script in wordpress head with no luck.

Read More

The scripts from the previous site look as follows.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<link rel="stylesheet" href="<?php echo $siteurl; ?>css/custom-theme/jquery-ui-1.8.1.custom.css" type="text/css" /> 
<script type="text/javascript" src="<?php echo $siteurl; ?>js/select-menu.js"></script>
<script type="text/javascript" src="<?php echo $siteurl; ?>js/init.js"></script>

init.js simply calls the function and works

$(function(){
    $('select#speedC').selectmenu({style:'dropdown'});
});

Now in WordPress i added the following to my head.

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/custom-theme/jquery-ui-1.8.1.custom.css" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />

<?php wp_enqueue_script( 'jquery-ui-core' ); ?>
<?php wp_enqueue_script( 'swfobject' ); ?>
<?php wp_enqueue_script( 'ui-core-select', get_bloginfo('template_directory') . '/js/select-menu.js' ); ?>
<?php wp_enqueue_script( 'jquery-pajinate', get_bloginfo('template_directory') . '/js/jquery.pajinate.js' ); ?>
<?php wp_enqueue_script( 'jquery-ui', get_bloginfo('template_directory') . '/js/jquery-ui.1.7.2.min.js' ); ?>

And the script in my page

<script type="text/javascript">
    $j=jQuery.noConflict();

    // Use jQuery via $j(...)
    $j(document).ready(function(){
        $j('select#speedC').selectmenu({style:'dropdown'});
    });
</script>

Any ideas why it is not initiating?

Related posts

Leave a Reply

2 comments