From 0d83ea38a66164887b5099eacb3fab9065b54f2b Mon Sep 17 00:00:00 2001 From: Jacob Haddon Date: Fri, 20 Nov 2020 13:22:33 -0500 Subject: [PATCH] removed header enqueues to lighten page loading: consider hard linking CSS and removing wphead --- functions.php | 33 ++++++++++++++++++++++++++++++--- mfwpt-notes.md | 6 ++++-- style.css | 7 ++----- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/functions.php b/functions.php index dac5fd2..47768c5 100644 --- a/functions.php +++ b/functions.php @@ -5,11 +5,10 @@ // enqueue the stye function mytheme_enqueue_style() { - wp_enqueue_style( 'style.min', get_stylesheet_uri() ); + wp_enqueue_style( 'style', get_stylesheet_uri() ); } add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_style' ); - //set up the menus function register_my_menus() { @@ -20,7 +19,35 @@ function register_my_menus() { ) ); } - add_action( 'init', 'register_my_menus' ); +add_action( 'init', 'register_my_menus' ); + +add_action( 'wp_enqueue_scripts', 'remove_actions_parent_theme'); +function remove_actions_parent_theme() { + remove_action('wp_head', 'rsd_link'); + remove_action('wp_head', 'wp_generator'); + remove_action('wp_head', 'feed_links', 2); + remove_action('wp_head', 'index_rel_link'); + remove_action('wp_head', 'wlwmanifest_link'); + remove_action('wp_head', 'feed_links_extra', 3); + remove_action('wp_head', 'start_post_rel_link', 10, 0); + remove_action('wp_head', 'parent_post_rel_link', 10, 0); + remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); + wp_dequeue_style( 'wp-block-library' ); + wp_dequeue_style( 'wp-block-library-theme' ); + wp_dequeue_style( 'wc-block-style' ); +} # remove_actions_parent_theme +function disable_emojis() { + remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); + remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); + remove_action( 'wp_print_styles', 'print_emoji_styles' ); + remove_action( 'admin_print_styles', 'print_emoji_styles' ); + remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); + remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); + remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); + add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); + add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 ); +} +add_action( 'init', 'disable_emojis' ); ?> diff --git a/mfwpt-notes.md b/mfwpt-notes.md index 7133037..f1848d9 100644 --- a/mfwpt-notes.md +++ b/mfwpt-notes.md @@ -1,7 +1,5 @@ Mother Fucking Wordpress Theme -remote git: /srv/dev-disk-by-label-mybook/git/mfwpt.git/ - Post: @@ -33,6 +31,10 @@ Look at this shit on your 8K monitor, then pull it up on your phone. Works. You see that? Seven (or so) extra CSS calls, and boom. Menu at the top you can format via WordPress. Even with dropdowns. Fast and organized. +## Motherfucking Dark Mode + +It's going to take longer to brag about adding dark mode with three lines than it was to add dark mode. + ## This is Satire Just like [the site that inspired this](http://motherfuckingwebsite.com/), and [the other site that styled this](http://bettermotherfuckingwebsite.com/). diff --git a/style.css b/style.css index d696e4b..7b73e7d 100644 --- a/style.css +++ b/style.css @@ -37,10 +37,7 @@ h1,h2,h3{line-height:1.2} .mfwpt_menu{} @media screen and (prefers-color-scheme: dark) { - body{ color: white;} - - body, .mfwpt_menu ul ul { - background-color: black; - } + body{ color: white;} + body, .mfwpt_menu ul ul {background-color: black;} }