Submitted by egbert on Tue, 11/25/2014 - 00:00
De stappen om een eigen JavaScript toe te voegen aan een WordPress installatie:
- Kopieer de volgende code in je functions.php file, het beste doe je dit in je child theme:
function wpb_adding_scripts() {
wp_register_script('my_script', get_template_directory_uri() . '/js/showPic.js', array('jquery'),'1.1', true);
wp_enqueue_script('my_script');
}add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );
?>
- Log in to post comments