Why isn’t my plugin script loaded in the backend?
It looks like you have accidentally typed: wp_enqueue_style(‘stent-extended-js’); instead of wp_enqueue_script( ‘stent-extended-js’ ); so that could explain why it’s not properly enqueued.
It looks like you have accidentally typed: wp_enqueue_style(‘stent-extended-js’); instead of wp_enqueue_script( ‘stent-extended-js’ ); so that could explain why it’s not properly enqueued.
Going off of the plugins source code I simply copied then changed the add_action(); to remove_action(); in my child-themes function.php add_action(‘wp_print_styles’, ‘add_advanced_recent_posts_widget_stylesheet’); Replace add with remove. remove_action(‘wp_print_styles’,’add_advanced_recent_posts_widget_stylesheet’); So simple. Now I know.
Since WP 4.6 prefetch dependencies are only generated when styles are enqueued, not when they are only registered. Since you are only enqueueing Font Awesome, that is the only prefetch link you get. If you enqueue all style files properly, your problem should be solved.
The only thing that I see is the argument ‘query_var’=>true, it can be set to false, but the default value is the taxonomy name, so set it to true is maybe the cause of the failure, even the codex example set it to true, I think it can be great to try register_taxonomy( ‘works_category’, ‘works’, … Read more
Before adding any file you must seperate your header.php file & add wp_head() function in header.php file // Load the theme stylesheets function theme_styles() { // Example of loading a custom css file for homepage just on the homepage wp_register_style( ‘custom’, get_template_directory_uri() . ‘/css/custom.css’ ); if(is_page(‘home’)) { wp_enqueue_style(‘custom’); } // Example of loading a main … Read more
In your example, $_SERVER[‘REQUEST_URI’] would return /category/post-slug/amp/ which is not the same as get_permalink($post->ID) which would return https://example.com/category/post-slug/ There are lots of ways to go about this, but one easy one that comes to mind is… if ( strpos($_SERVER[‘REQUEST_URI’], ‘/amp/’ ) !== false ) { The strpos() PHP function finds the position of 2nd string … Read more
plugins_url expects the second parameter to be the main plugin file, which is why __FILE__ is used in examples, it’s assuming the code is in that file, but yours is not. To fix this, you will need to retrieve __FILE__ in your main plugin file, store it, and pass it to your shortcode objects for … Read more
You need to hook it to an action. Add the below code to the theme’s functions.php file. It should work. add_action( ‘wp_enqueue_scripts’, ‘theme_flexslider_css’ ); function theme_flexslider_css() { wp_register_style( ‘flexslider’, get_template_directory_uri() . ‘/css/flexslider.css’ ); if( is_page( ‘home’ ) ) { wp_enqueue_style( ‘flexslider’ ); } }
Use the correct action hook Notice the action hook being used: add_action( ‘wp_enqueue_scripts’, ‘add_our_scripts’,0); And the action hook you’re defining/using: add_action( ‘test_remove_scripts’, ‘remove_radium_scripts’, 999 ); You need to hook into the same action: add_action( ‘wp_enqueue_scripts’, ‘remove_radium_scripts’, 999 ); Use the correct priority Notice the priority being used: add_action( ‘wp_enqueue_scripts’, ‘add_our_scripts’,0); And the priority you’re using: … Read more
There are no functions in wordpress that checks or determine screen sizes. These are all browser related stuff that has got nothing to do with wordpress. There are jquery functions that can maybe work, but again, this is not wordpress related. wp_is_mobile can be used to load stuff conditionally for mobile phones, but then again, … Read more