Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function my_enqueue_script() {
if ( is_page() ) {
wp_enqueue_script( 'page', plugins_url( '/js/page.js', __FILE__ ) );
} else {
wp_enqueue_script( 'rest', plugins_url( '/js/rest.js', __FILE__ ) );
add_action( 'wp_enqueue_scripts', 'my_enqueue_script' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.