Drop Down Menu not working
-
the drop down menus are not working
screenshot : http://i49.tinypic.com/ip07xx.jpg
-
It looks like you’re trying to make a drop-down menu using this drop-down menu script: http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm
However, your page doesn’t include the necessary JavaScript. You can grab that here: http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.js
You’ll need to save that JavaScript file to your website and then load it on every page. For information about enqueue-ing scripts, check this out: http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Also, on another note, I would suggest a different drop-down menu script such as SuperFish (http://users.tpg.com.au/j_birch/plugins/superfish/) because it still functions even if a user has JavaScript disabled.
Good luck!
I am not a coder, how can I use that SuperFish ?
Well I’m not sure how much you really know, but here’s what looks like a reasonable tutorial: http://kav.in/wordpress-superfish-dropdown-menu/
However, to follow that tutorial, it looks like you will need to know some basic HTML and CSS and just a little bit of jQuery.
If you’re not comfortable with that, you can stick with the script you’re currently trying to use simply by adding this anywhere to your theme’s functions.php file:
function ddsmoothmenu_js() { wp_register_script( 'ddsmoothmenu', get_bloginfo('stylesheet_directory').'/ddsmoothmenu.js'); wp_enqueue_script( 'ddsmoothmenu' ); } add_action('wp_enqueue_scripts', 'ddsmoothmenu_js');To find you’re theme’s functions.php file, look in the /wp-content/themes/ folder for your theme’s name and functions.php should be in the root of that folder.
You’ll also have to upload a copy of this JavaScript file to your website in the same folder as functions.php: http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.js
added that to functions.php file
still nothing π
and thanks for helping me outIt looks like the function didn’t make it to the site. Are you sure you uploaded it to the site properly? Also, are you sure that you added the function to the correct theme’s function.php file? Also, please make sure you didn’t put the function inside of another function (to be sure, just add the function all the way at the end of the file).
added to the end, now giving me errors on site
please checkAhhh that’s very weird. Let’s just do this the “cheating” way π
Edit your header.php file and add this line of HTML somewhere between
<head>and</head>(somewhere around the scripts would make sense):<script type='text/javascript' src='http://www.la-redd.com/wp-content/themes/echoes/ddsmoothmenu.js'></script>You can now delete that function from functions.php.
deleted
added
nothing πGood news, though! The JavaScript file has been successfully added to the page! It just looks like we need to initiate the script now. Add this right below where you added that last line in header.php:
<script type="text/javascript"> ddsmoothmenu.init({ mainmenuid: "smoothmenu1", //menu DIV id orientation: 'h', classname: 'ddsmoothmenu', //class added to menu's outer DIV contentsource: "markup" }) </script>Oh, one more thing: add this right below the above (again, in header.php) to remove those broken images in your top navigation:
<style type="text/css"> .downarrowclass {display:none;} </style>added both
the drop down is not coming
but site is taking longer time to load πOh, my bad! I should have specified that you have to add all of this stuff after jQuery. Try putting all of this stuff right before </head>
all working now
sweet
[ redacted, support is offered via the forum and not email or skype. ]Awesome! Glad it’s finally working! π
My email address is: [ redacted, support is offered via the forum and not email ]
The topic ‘Drop Down Menu not working’ is closed to new replies.