Location: everywhere
Untitled Snippet
Universal Noindex Snippet (Rank Math + Yoast + AIOSEO Compatible)
/** * Always force noindex on: * – Password-protected posts/pages (even after password is entered) * – Private posts/pages * Compatible with Rank Math, Yoast SEO, and AIOSEO */ function vb_should_force_noindex() { global $post; if ( ! $post ) {…Continue reading
HTML Sitemap Archive Pages
/** * Enhances AIOSEO HTML Sitemap: * – Links CPT headings to their archive URLs (including Blog) * – Moves the “Posts” section right after “Pages” * – Preserves all AIOSEO settings, filters, and structure * * Fixed bugs: *…Continue reading
weather functionality
add_shortcode(‘nws_weather’, function () { $lat = ‘38.8977’; $lon = ‘-77.0365’; // Fetch NWS data $meta = wp_remote_get(“https://api.weather.gov/points/{$lat},{$lon}”); if (is_wp_error($meta)) return ‘Weather unavailable.’; $meta_data = json_decode(wp_remote_retrieve_body($meta), true); if (!$meta_data || empty($meta_data[‘properties’])) return ‘Invalid location.’; $forecast_url = $meta_data[‘properties’][‘forecast’]; $zone = basename($meta_data[‘properties’][‘forecastZone’]); $station_url…Continue reading
Weather Nav Snippet
add_shortcode(‘current_weather_nav’, function () { $lat = ‘38.8977’; // Update this to your location $lon = ‘-77.0365’; // Fetch point metadata $meta = wp_remote_get(“https://api.weather.gov/points/{$lat},{$lon}”); if (is_wp_error($meta)) return ”; $meta_data = json_decode(wp_remote_retrieve_body($meta), true); if (empty($meta_data[‘properties’])) return ”; // Get station $station_url =…Continue reading
Redirect URL + /story/
/** * WPCode snippet: Redirect old post URLs https://domain.com/ * to new URLs https://domain.com/stories/ (301) * * – Multisite-safe (runs per-site) * – Only redirects if the old top-level path is a real *post* slug * – Does NOT affect…Continue reading
Membership Details Table Override
/** * Membership Details Table Override * * Child Theme: Storefront-Child-Theme * WC Vendors Membership Template * * Hides certain rows for free plans while keeping table formatting. */ if ( ! defined( ‘ABSPATH’ ) ) { exit; // Exit…Continue reading
Paystack Split Payments Integration with WC Vendors — Creating the Split Configuration
public function process_split_payment( $order ) { $vendors_due = WCV_Vendors::get_vendor_dues_from_order( $order, false ); $sub_accounts = array(); foreach ( $vendors_due as $vendor_id => $products ) { $_vendor_account = get_user_meta( $vendor_id, ‘_paystack_sub_account_code’, true ); $sub_accounts[] = array( ‘subaccount’ => $_vendor_account, ‘share’ => $calculated_share,…Continue reading
Limit Post Revisions
add_filter( ‘wp_revisions_to_keep’, function( $num, $post ) { return 10; }, 10, 2 );Continue reading