// Only load these helpers when WP All Import is running (admin/cron/cli), // or when explicitly requested via a filter. if ( !defined(‘WP_CLI’) && !wp_doing_cron() ) { // If we’re not in admin, no need. if ( !is_admin() ) {…Continue reading
/** * Charitable Email Preview Debug Tool (WPCode-ready) * * WPCODE INSTRUCTIONS: * 1. Install WPCode plugin (Insert Headers and Footers) * 2. Code Snippets → + Add Snippet → “Add Your Custom Code (New Snippet)” * 3. Title: “Charitable…Continue reading
/** * Fallback meta description ONLY when Yoast meta description is empty. * Works with Yoast Premium + WPCode. */ add_filter(‘wpseo_metadesc’, function ($metadesc) { // Only on single blog posts if (!is_singular(‘post’)) { return $metadesc; } // If Yoast already…Continue reading
/** * 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
/** * 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 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
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