Edit all $wp_scripts at once to $in_footer = false
Make all scripts and styles be placed in [duplicate]
Make all scripts and styles be placed in [duplicate]
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
I’ll guess it’s because plugins_loaded is too early to enqueue styles. The wp_enqueue_scripts action is the appropriate action for enqueueing scripts and styles.
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
Since theme developers don’t always enqueue their styles and often hardcode the link, what’s the best way around this? There is no way around this. Simply said: Let them burn. They’re doing it wrong and as a 3rd party code developer you don’t have to take wannabe developers into account.
Since 4.5 there is a function that lets you append inline js to an enqueued js file, it is called wp_add_inline_script. Now, this function does not let you add any js code that has a </script> in it for security reasons. But when you look at the wp_add_inline_script source code, you can see that it … Read more
the_header() does not even seem to be native WP function? Technically getting header isn’t what really causes styles and scripts to load, it’s wp_head() call that should be made there (and wp_footer() call in footer). So they are likely what you should be using. If you do need something lower level you might want to … Read more
Lead dev of Redux here. If you declare global $redux_global in your header.php file, it will be accessible by all other template files within your theme. You can also use $GLOBALS[‘redux_global’][‘css-block’] to bypass the need for $global $redux_global.
It seems the problem was it wasn’t recognizing it was a page in the first place and thus couldn’t recognize if there was a template applied to it. Changed if (is_page_template(‘page-templates/page-nosidebar.php’)) { to if (is_page() && !is_page_template(‘page-templates/page-nosidebar.php’)) {
I think your big problem here is your use of underscores (_) in your page template names. According to the Handbook of Coding Standards Files should be named descriptively using lowercase letters. Hyphens should separate words. my-plugin-name.php Also, for best practices you should call your custom page templates page-whatever.php So for instance, index_page.php should be … Read more