Bootstrap 5

// Add custom scripts function add_custom_script_bootstrap5() { wp_register_script( ‘bootstrap5_js’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.min.js’, array(), ‘5.3.3’, true ); wp_enqueue_script( ‘bootstrap5_js’ ); wp_register_style( ‘bootstrap5_css’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css’, array(), ‘5.3.3’, true ); wp_enqueue_style( ‘bootstrap5_css’ ); wp_register_style( ‘bootstrap5_css_containers’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/scss/_containers.scss’, array(), ‘5.3.3’, true ); wp_enqueue_style( ‘bootstrap5_css_containers’ ); } add_action( ‘wp_enqueue_scripts’,…Continue reading

webfontloader.js

// Add custom scripts function add_custom_script_webfont_loader_js() { wp_register_script( ‘webfontloader’, ‘https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js’, array(), ‘1.6.28’, true ); wp_enqueue_script( ‘webfontloader’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_webfont_loader_js’ );Continue reading

fontfaceObserver.js

// Detect if web fonts are available function add_custom_script_font_face_observer_js() { wp_register_script( ‘fontface_observer’, ‘https://cdnjs.cloudflare.com/ajax/libs/fontfaceobserver/2.3.0/fontfaceobserver.standalone.js’, array(), ‘2.3.0’, true ); wp_enqueue_script( ‘fontface_observer’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_font_face_observer_js’ );Continue reading

masonry.js

// Add custom scripts function add_custom_script_masonry_js() { wp_register_script( ‘masonry’, ‘https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js’, array(), ‘4’, true ); wp_enqueue_script( ‘masonry’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_masonry_js’ );Continue reading

Admin/Nav Extension – JS

jQuery(function($) { var $page_title = $(“#wpbody-content > .wrap > h1”); var $current_menu_item = $(“#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu”); if ($current_menu_item.length == 1) { var $menu_links = []; var $submenu = $current_menu_item.parent().find(“ul > li > a”); var $header_nav = $(“ “).addClass(“mx_nav”); var $title…Continue reading

Automatic CSS/JavaScript Cache Busting

/** * Replace the `ver` query arg with the file’s last modified timestamp * * @param string $src URL to a file * @return string Modified URL to a file */ function filter_cache_busting_file_src( $src = ” ) { global $wp_scripts;…Continue reading

Automatic CSS/JavaScript Cache Busting

/** * Replace the `ver` query arg with the file’s last modified timestamp * * @param string $src URL to a file * @return string Modified URL to a file */ function filter_cache_busting_file_src( $src = ” ) { global $wp_scripts;…Continue reading