-1

This is the url for the html template :

All the js functions are working on this but with with the same javascript and jQuery codes when integrating it with wordpress the url for it is here

All the js functions stop running such as : animation , mobile meenu , smooth scrolling , scroll to top , sticky menu ..

Can you help in this ?

2 Answers2

0

You should enqueue your Jquery scripts in functions.php file in your WP theme. Use wp_enqueue_script() function for this. For example, to invoke your local script.js file you should do something like this in your functions.php:

function invokeThemeScripts() {
    wp_enqueue_script( 'my_script', get_template_directory_uri() . '/path/to/your/script.js', array('jquery'), true);
}
add_action('wp_enqueue_scripts', 'invokeThemeScripts');

Refer to WP Codex for more details. As in static HTML page you are calling all your scripts and styles in the head of the document(or before closing body tag for scripts), transferring to WP requires you as a developer to delegate calling your theme styles and scripts to WP.

Also, as it was mentioned before WordPress will not recognize short $ syntax for your jQuery scripts. What I always do is covering all my jQuery functions into a self-invoking function with noConflict declaration.

jQuery(function () {
    'use strict';
    var $ = jQuery.noConflict();

    /* your script */
}); 
markoffden
  • 1,406
  • 1
  • 15
  • 31
0

Wrap your code (the files: jquery.equalheights.js jquery.rd-navbar.js superfish.js)in:

jQuery(document).ready(function($) {
    // Your code here
});
Ahmad Alzoughbi
  • 474
  • 1
  • 5
  • 14