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 am having a heck of a time trying to get this simple function to work in WP using ubermenu: My goal is to have dropdown menu-itm-156 fire when the document.ready and control it based on which page you are on.

<?php

$page = array( 42, 'page1', 'Page Title' );
$post = array( 1, 'post1', 'Post Title' );
if ( is_page($page) || is_single($post) ) {
?>
<script type="text/javascript">
jQuery(function($) {
$('#menu-item-156').mouseover(function(){
    $(this).find('ul').slideDown();
});

$('#menu-item-156').trigger('mouseover');
});
</script>
<?php  }  ?>

Any help would be a life saver,

Thank you

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.