include js menu
-
I’m trying to implement a responsive menu to the starter theme Underscores. I’ve tried two days but I can not understand where I’m wrong. For the scripts I relied on the website that provides jqueryscript.net script. where I tried, in addition to the one mentioned, to implement this
https://www.jqueryscript.net/menu/Mobile-friendly-Multi-level-Dropdown-Menu-Plugin-jQuery-Stellarnav.html
I registered the style and the script through the appropriate functionswp_enqueue_style('styles', get_template_directory_uri() . '/ ');
And
wp_enqueue_script( scritp', get_template_directory_uri() . '/js/scritp');
then I assigned the appropriate ID and classes to the menu with
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu', 'container' => 'div', 'container_class' => 'stellarnav', 'container_id' => 'main-nav',) );?>
I tried to implement the instructions either by calling the file (a.js) with inside:
jQuery( document ).ready( function( $ ) { $('#main-nav').stellarNav({ // adds default color to nav. (light, dark) theme : 'dark', // number in pixels to determine when the nav should turn mobile friendly breakpoint: 768, // adds a click-to-call phone link to the top of menu - i.e.: "18009084500" phoneBtn: false, // adds a location link to the top of menu - i.e.: "/location/", "http://site.com/contact-us/" locationBtn: false, // makes nav sticky on scroll sticky : false, // 'static' or 'top' - when set to 'top', this forces the mobile nav to be placed absolutely on the very top of page position: 'static', // shows dropdown arrows next to the items that have sub menus showArrows: true, // adds a close button to the end of nav closeBtn : false, // fixes horizontal scrollbar issue on very long navs scrollbarFix: false });
in function.php with the string wp_enqueue_script and is directly from the header enclosed in the tags
<script type = "text / javascript"> </ script>
But without getting results, I was wrong somewhere?sorry for my google english translator
Thanks so much
- The topic ‘include js menu’ is closed to new replies.