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.

new to this forum & new to wordpress. I have read about Slide and Push menu functionality in http://tympanus.net/codrops/2013/04/17/slide-and-push-menus/

How to implement this on a WordPress site? I mean, I go the HTML, css part but where to place/upload the js part. In short, how I make this working in a WP site.

More details

From that tutorial, I have placed the HTML part in a WP post text editor; placed the CSS part in my sites child-theme style.css file; then uploaded the JavaScript in my themes js folder (../wp-content/themes/MyThemeName/js/menuk.js),

Then placed

add_action( 'wp_enqueue_scripts', 'exmaple_enqueue' );

function exmaple_enqueue() {
  $ss_url = get_stylesheet_directory_uri();
  wp_enqueue_script( 'menuk', "{$ss_url}/js/menuk.js" );
}

But nothing seems to work? Any help will be appreciated.

Thanks

share|improve this question
    
Do you see the script being included in page source? Any error in browser's console? –  Rarst Jun 29 at 17:19
    
Thanks for your reply. I could see an js error in the console {Failed to load resource: the server responded with a status of 404 (Not Found) example.localhost.com/wp-content/themes/Divi-child/js/…} I think there is a problem with my child theme.. not sure when it's going wrong. –  KBD Jun 30 at 5:30

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.