Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks.

function my_admin_scripts() {
  wp_enqueue_style( 'admin-css', get_stylesheet_directory_uri() . '/admin/css/admin.css' );
  wp_enqueue_script( 'admin-js', get_stylesheet_directory_uri() . '/admin/js/admin.js', true );
}
add_action( 'admin_enqueue_scripts', 'my_admin_scripts' );
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #Scripts #styles #registered #enqueued
ADD COMMENT
Topic
Name
4+8 =