using slicknav without plugin
-
I downloaded slicknav files and enqueue it’s css and js in my wordpress and yet the slicknav menu not appearing. what could be wrong?
/** * Enqueue scripts and styles. */ function ebson_store_scripts() { /** * Style */ wp_enqueue_style( 'ebson-store-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css' ); wp_enqueue_style( 'ebson-store-slick', get_template_directory_uri() . '/assets/css/slick.css' ); wp_enqueue_style( 'ebson-store-slicknav', get_template_directory_uri() . '/assets/css/slicknav.min.css' ); wp_enqueue_style( 'ebson-store-fontawesome', get_template_directory_uri() . '/assets/css/font-awesome.css' ); wp_enqueue_style( 'ebson-store-google-font', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600,700,800|Poppins:300,400,400i,500,600,700,800,900&display=swap', false ); wp_enqueue_style( 'ebson-store-style', get_stylesheet_uri(), array(), _S_VERSION ); wp_style_add_data( 'ebson-store-style', 'rtl', 'replace' ); /** * Scripts. */ wp_enqueue_script( 'jquery'); wp_enqueue_script('ebson-store-bootstrap-bundle-minjs', get_template_directory_uri() . '/assets/js/bootstrap.bundle.min.js', array( 'jquery' ),'',true); wp_enqueue_script( 'ebson-store-jquery-2.1.3js', 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js', array( 'jquery' ),'1.0.5',true); wp_enqueue_script( 'ebson-store-mainjs', get_template_directory_uri() . '/assets/js/main.js', array( 'jquery' ),'',true); wp_enqueue_script( 'ebson-store-modernizr-2.8.3.minjs', get_template_directory_uri() . '/assets/js/modernizr-2.8.3.min.js', array( 'jquery' ),'',true); wp_enqueue_script( 'ebson-store-slicknav-minjs', '/assets/js/jquery.slicknav.min.js', array( 'jquery' ),'',true); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'ebson_store_scripts' ); //Footer script function ebson_store_footer_javascript() { ?> <script> jQuery(function(){ jQuery('#primary-menu').slicknav(); }); </script> </script> <?php } add_action( 'wp_footer', 'ebson_store_footer_javascript' );
- The topic ‘using slicknav without plugin’ is closed to new replies.