Plugin Activation Causes wp_register errors

The warning is self-explanatory: Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. You have to call wp_register_style on the correct hooks: wp_enqueue_scripts for the frontend admin_enqueue_scripts for the backend login_enqueue_scripts for the login page Calling wp_register_script on any other hook, or no … Read more

Use conditionals with wp_enqueue_style to attach stylesheet according to post type displayed

The issue in your first block of code is syntax: if( get_post_type() == ( ‘activity’ OR ‘dining’ OR ‘heritage’ OR ‘hiking’ OR ‘nightlife’ ) ) : this isn’t proper use of OR and will evaluate true regardless of what get_post_type() returns. The issue in your second block is again syntax, you have to break; at … Read more

Deregister a CSS file that comes with a plugin

You can use wp_dequeue_style function, with a wp_enqueue_script hook with priority higher than WPML’s wp_enqueue_script hook. Put the following code into your functions.php: function dequeue_wpml_styles(){ wp_dequeue_style( ‘wmpl_style_handle’ ); } add_action( ‘wp_enqueue_scripts’, ‘dequeue_wpml_styles’, 20 ); REPLACE ‘wmpl_style_handle’ with the handle WPML registers/enqueues the style. UPDATE: I have just had a look into WPML and it looks … Read more