Skip to content

Instantly share code, notes, and snippets.

View lowegreg's full-sized avatar

Greg Lowe lowegreg

View GitHub Profile
@lowegreg
lowegreg / functions.php
Created May 2, 2021 10:30 — forked from tripflex/functions.php
Fix Select2 issues with WordPress Admin Bar
<?php
add_action( 'wp_head', 'smyles_output_select2_admin_bar_fix' );
function smyles_output_select2_admin_bar_fix() {
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type = "text/css"';
/**
* We use ~ here instead of + for any situations where something else ends up attaching to body as well
*/
?>
<style<?php echo $type_attr; ?> media="screen">