removed header enqueues to lighten page loading: consider hard linking CSS and removing wphead

This commit is contained in:
Jacob Haddon 2020-11-20 13:22:33 -05:00
parent 63c1f91074
commit 0d83ea38a6
3 changed files with 36 additions and 10 deletions

View File

@ -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' );
?>

View File

@ -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/).

View File

@ -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;}
}