javascript - wordpress http 500 error after adding custom jquery -


i have been attempting different methods of adding jquery site while - , found best practice enqueue in functions.php. trying add 'sticky' nav bar snaps top of page user scrolls down. when site 500 error , have remove site , running.

it functions.php code enqueue script or script causing problem - have not been able identify , of course why. (could there issue how server set up? lack of resources/permissions ect?)

here functions.php extract:

    function verdigris_script() { // register script location, dependencies , version    wp_register_script('custom_js',    get_template_directory_uri() . '/js/scripts.js',    array('jquery'),    '1.0', true );  function scripts_enqueue() {     //css     wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), 'all');     wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/verdigris-style.css', array(), 'all');     //js     wp_enqueue_script('jquery');     wp_enqueue_script('bootstrapjs', get_template_directory_uri() . '/js/bootstrap.min.js', array(), true);     wp_enqueue_script('custom_js');  } add_action( 'wp_enqueue_scripts', 'verdigris_script'); 

and script:

    jquery(function() {   var $container = $('.container');   var $b = $('body');   $.waypoints.settings.scrollthrottle = 0;   $container.waypoint({     handler: function(e, d) {       $b.toggleclass('sticky', d === 'down');       e.preventdefault();     }   }); }); 

am asking if can identify issue.

many in advance.

you have error in php code.

you're unintentionally declaring function inside function , never closing it.

remove:

function scripts_enqueue() { 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -