remove WordPress bloat

/** * Removes block library CSS from WordPress * * @package thewpx */function thewpx_remove_block_library_css() { wp_dequeue_style( 'wp-block-library' ); wp_dequeue_style( 'wp-block-library-theme' ); wp_dequeue_style( 'wc-block-style' ); wp_dequeue_style( 'storefront-gutenberg-blocks' );}add_action( 'wp_enqueue_scripts', 'thewpx_remove_block_library_css', 100 );/** * Disable the emojis */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' );…

WordPress related posts by tag or category

<code> <?php $orig_post = $post; global $post; $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; $args=array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'showposts'=>5, // Number of related posts that will be shown. 'ignore_sticky_posts'=>1 ); $my_query = new wp_query($args); if( $my_query->have_posts() ) { echo 'from the same tag<br /><ul>';…

wp updates complete

contents of wp.sh awk 'BEGIN {print "From: \nTo: \nSubject: wp update results \n \n" > "/Users/joel/sh/mail/'$(date +"%Y%m%d")'-update-wp.txt"}'; awk 'BEGIN {print "From: \nTo: \nSubject: wp update errors \n \n" > "/Users/joel/sh/mail/'$(date +"%Y%m%d")'-errors-wp.txt"}'; ssh cweb "bash -s" < /Users/joel/sh/wp/update-wp.sh >> /Users/joel/sh/mail/$(date +"%Y%m%d")-update-wp.txt 2>> /Users/joel/sh/mail/$(date +"%Y%m%d")-errors-wp.txt; sh /Users/joel/sh/wp/wpc.sh exit 0 contents of update-wp.sh cd…

wp doctor yaml custom input

ignore column headers in results wp doctor check --all --spotlight --format=csv --fields=status,name | tail -n +2 Let’s take a look at the first two checks in the included doctor.yml: autoload-options-size: check: Autoload_Options_Size constant-savequeries-falsy: check: Constant_Definition options: constant: SAVEQUERIES falsy: true In this example:
  • autoload-options-size and constant-savequeries-falsy are the names for the checks. Names must…

custom theme: big hero

full screen hero image, like LP's site was <div class="crossfade"> <figure></figure> <figure></figure> <figure></figure> <figure></figure> <figure></figure> </div> <article> <h1>Photos</h1> <div class="px"> <div class="px-ly px-ly-2"> <img loading="lazy" src="image01.jpg" width="640" height="800" /> <img loading="lazy" src="image02.jpg" width="640" height="800" /> <img loading="lazy" src="image03.jpg" width="640" height="800" /> <img loading="lazy" src="image04.jpg" width="640" height="800" /> </div> <div class="px-ly px-ly-1"> <img loading="lazy" src="image05.jpg" width="640"…

fancy schmancy post navigation php for single.php

<?php /** * The template for displaying all single posts * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * @package NotWhatIMeant */ get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main"> <?php while ( have_posts() ) : the_post(); get_template_part( 'template-parts/content', get_post_type() ); ?> <nav class="navigation post-navigation" role="navigation"> <h2> class="screen-reader-text">Post navigation</h2> <div class="nav-links"> <?php $prev_post = get_previous_post(); if (!empty( $prev_post )): $prev_post_thumbnail_id…