delay wordpress RSS feed to catch post errors, etc. before posts land in RSS catchers..

<?php

function evo_delay_rss_feed( $where ) {
	global $wpdb;
	if ( is_feed() ) {
		$now = gmdate( 'Y-m-d H:i:s' );
		$wait = '1'; // integer 
		$device = 'HOUR'; // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR 
		$where .= " AND TIMESTAMPDIFF( $device, $wpdb->posts.post_date_gmt, '$now' ) > $wait ";
	}
	return $where;
}
add_filter( 'posts_where', 'evo_delay_rss_feed' );
View Post

disable colors, custom colors and custom gradients from blocks in post/page editor..

add_theme_support( 'disable-custom-colors' );
add_theme_support( 'editor-color-palette', array() );
add_theme_support( 'disable-custom-gradients' );
add_theme_support( 'editor-gradient-presets', array() );

..this will keep blocks consistent with existing theme colors

View Post

the function below will remove the URL field from the comment form..

function unset_url_field( $fields ) {
    if( isset( $fields['url'] ) )
       unset( $fields['url'] );
       return $fields;
}
add_filter( 'comment_form_default_fields', 'unset_url_field' );
View Post

..more CSS revisions in the works for my themes to cleanup and simplify the styling for the blocks using the following attribute selectors..

*[class^="wp-block-"] {
	margin-top: 2rem;
	margin-bottom: 2rem;
}
*[class^="wp-block-"] figcaption {
	margin-top: 0.5rem;
	margin-bottom: 0;
}
*[class$="_inner-container"] {
	margin: 0;
}
.wp-block-columns {
	margin: 2rem 0 -2rem 0;
}
.wp-block-column {
	margin: 0 0 2rem 0;
}
*[class$="_inner-container"] > *:first-child,
.wp-block-column > *:first-child {
	margin-top: 0;
}
*[class$="_inner-container"] > *:last-child,
.wp-block-column > *:last-child {
	margin-bottom: 0;
}

..i’m still working on a couple of full blog posts about theme updates i implemented to update them to the newer default block editor from the classic editor..

View Post

i will prob expand this into a full blog post on the main blog, but here’s a quick way to selectively load the CSS and JS for Contact Form 7 only on pages..

<?php
add_filter( 'wpcf7_load_css', '__return_false' );
add_filter( 'wpcf7_load_js', '__return_false' );
function load_cf7_css_js() {
	if ( is_page() ) {
		if ( function_exists( 'wpcf7_enqueue_scripts' ) ) wpcf7_enqueue_scripts();
		if ( function_exists( 'wpcf7_enqueue_styles' ) ) wpcf7_enqueue_styles();
	}
}
add_action( 'get_header', 'load_cf7_css_js' );
View Post

fluid typography..

body {
	font-size: calc(18px + (24 - 18) * ((100vw - 320px) / (2560 - 320)));
}

View Post