Yoast Post Meta Fix

/** * Add a meta description for posts if Yoast doesn’t output one. * Network-safe for multisite. Only runs on singular posts and only * if no description is already set by Yoast or another plugin. */ add_action(‘wp_head’, function ()…Continue reading

Yoast Post Meta Fix

/** * Add a meta description for posts if Yoast doesn’t output one. * Network-safe for multisite. Only runs on singular posts and only * if no description is already set by Yoast or another plugin. */ add_action(‘wp_head’, function ()…Continue reading

Yoast Fix Multisite

/** * Network-wide Yoast Schema fixes for domain-mapped multisite: * – Force posts to output NewsArticle schema type * – Ensure publisher / organization / copyrightHolder references * use each subsite’s mapped domain (home_url), not the origin domain. * *…Continue reading

Automatically Set Image Title & Alt-Text upon upload

/* Automatically set the image Title & Alt-Text upon upload*/ add_action( ‘add_attachment’, ‘my_set_image_meta_upon_image_upload’ ); function my_set_image_meta_upon_image_upload( $post_ID ) { // Check if uploaded file is an image, else do nothing if ( wp_attachment_is_image( $post_ID ) ) { $my_image_title = get_post(…Continue reading

Sort Pages & Posts by Date in WP Dashboard

function set_post_order_in_admin($wp_query) { global $pagenow; if (is_admin() && ‘edit.php’ == $pagenow && !isset($_GET[‘orderby’])) { $wp_query->set(‘orderby’, ‘date’); $wp_query->set(‘order’, ‘DESC’); } } add_filter(‘pre_get_posts’, ‘set_post_order_in_admin’);Continue reading

Admin Footer Klovera Support Link

/** * Klovera Admin UI – Global * – Remove WooCommerce rating / marketing notices * – Replace admin footer with Klovera support message * – Optional: hide WordPress version text */ /** * 1) Remove WooCommerce admin notices (rating,…Continue reading

Hide Admin Notices for Non-Admins

/** * Hide admin notices for non-admin roles */ add_action(‘admin_init’, function () { if (!current_user_can(‘administrator’)) { remove_all_actions(‘admin_notices’); remove_all_actions(‘all_admin_notices’); } });Continue reading