Enqueue CSS Into Specific Admin Page
-
I am trying to enqueue a CSS style sheet (and .js file) on a specific Admin Page).
I have gone through the WP documentation found here – Plugin API/Action Reference/admin enqueue scripts .
Below is my code. This code is almost verbatim from the WP documentation. There is no file being enqueued into the head of plugin when I implement the below code. When I change != $hook to == $hook, the style sheet is enqueued into the head of every admin page. Any help would be greatly appreciated.
function wpgel_localseo_bootstrap_styles($hook) { if ( 'plugins.php' != $hook ) { return; } wp_enqueue_style( 'wpgel_localseo_bootstrap_styles', plugins_url( 'wpgel-localseo/css/bootstrap.min.css' ) ); } add_action( 'admin_head', 'wpgel_localseo_bootstrap_styles' );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Enqueue CSS Into Specific Admin Page’ is closed to new replies.