Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active August 20, 2023 01:41
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Shelob9/931a6ef55d74ece0eaef8918a02d1435 to your computer and use it in GitHub Desktop.
Save Shelob9/931a6ef55d74ece0eaef8918a02d1435 to your computer and use it in GitHub Desktop.
add_action( 'wp_enqueue_scripts', 'my_custom_script_load' );
function my_custom_script_load(){
wp_enqueue_script( 'my-custom-script', get_stylesheet_directory_uri() . '/custom-scripts', array( 'jquery' ) );
}
add_action( 'wp_enqueue_scripts', 'my_custom_script_load' );
function my_custom_script_load(){
wp_enqueue_script( 'my-custom-script', plugin_dir_url( __FILE__ ) . '/custom-scripts', array( 'jquery' ) );
}
<?php
/**
Plugin Name: Header Scripts
*/
add_action( 'wp_head', 'my_header_scripts' );
function my_header_scripts(){
?>
<script>alert( 'Hi Roy' ); </script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment