Including Styles and JS files to work ON my plugin interface

Well after a bit of better searching i found the answer, function my_enqueue($hook) { if ( ‘settings_page_data-layer-management’ != $hook ) { return; } wp_enqueue_script( ‘my_custom_script’, plugins_url( ‘js/dlm-window.js’, __FILE__ )); } add_action( ‘admin_enqueue_scripts’, ‘my_enqueue’ ); to explain just incase anyone has this issue. what i had earlier was a ‘front-end’ hook which is just wp_enqueue_scripts for … Read more

How to get rid off default css styles

there are two ways, first: if you want to remove default style, just dequeue them using wp_dequeue_style( ‘style_file_name_here’ ). second: you can rename the existing file and create a new one with the same name, just place style hook info into new style file, like: /* Theme Name: Theme name Author: Author name */ remember, … Read more

Load stylesheet on custom admin submenu page

Ok, I figured it out: If it’s a submenu page, the $hook looks like this: appearance_page_page-name instead of going by URL. So the complete code would be this: function my_function($hook) { if ( ‘appearance_page_page-name’ != $hook ) { return; } wp_enqueue_style( ‘custom-style’, get_template_directory_uri() . ‘custom-page/style.css’ ); } add_action( ‘admin_enqueue_scripts’, ‘my_function’ );

using wp enqueue style to create a CSS file specifically for a page template

If “/styledtwentyfifteen” is your child directory then that’s included by get_stylesheet_directory_uri() (of which bloginfo(‘stylesheet_directory’) is an alias) so you should leave it out on registering: function register_more_stylesheets() { wp_register_style( ‘stylesheet_name’, get_stylesheet_directory_uri() . ‘/background-slider-template.css’ ); } Similarly with is_page_template() you only need the file name (relative to the template directory), and if you register a style … Read more

Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme

Ok, the first-thing I wanted to double-check is that rather than make any modifications to parent PHP, you simply create one with a duplicate name in the child directory which completely overrides the parent file? No. You don’t create a theme with the same name. You create a theme with whatever name you choose and … Read more