Widget-Park-Details-Sidebar

if (get_field(‘size_of_park_in_acres’)) { the_field(‘size_of_park_in_acres’); echo ‘ Acres‘; } if (get_field(‘g_architect’)) { the_field(‘g_architect’); echo ‘‘; } if (get_field(‘short_name_for_buttons’)) { echo ‘ ‘; the_field(‘short_name_for_buttons’); echo ‘ Amenities ‘; } if (get_field(‘park_restrooms’)) { echo ‘Restrooms: Yes‘; } else { echo ‘Restrooms: No‘; }…Continue reading

WP Simple Pay: Google GA4 Payment Conversion Tracking (copy)

/** * @link https://library.wpcode.com/snippet/j57gxn45/ */ add_action( ‘simpay_payment_receipt_viewed’, /** * Runs the first time the payment confirmation page is viewed. * * @param array $payment_confirmation_data */ function( $payment_confirmation_data ) { // Payment customer data (not used in this example). $customer =…Continue reading

Blocking search from bots

add_action(‘pre_get_posts’, function($query) { if ($query->is_search() && !is_admin()) { $referer = wp_get_referer(); $site_url = get_site_url(); if (empty($referer) || strpos($referer, $site_url) !== 0) { // Block the request early to save CPU header(‘HTTP/1.1 403 Forbidden’); exit; } } });Continue reading

change search url

function wpb_change_search_url() { if ( is_search() && ! empty( $_GET[‘s’] ) ) { wp_redirect( home_url( “/search/” ) . urlencode( get_query_var( ‘s’ ) ) ); exit(); } } add_action( ‘template_redirect’, ‘wpb_change_search_url’ );Continue reading

0000 > CLASS > Show Data

// this is the class definition class myfair_Show_Data { public function __construct() { $this->loadShows(); if (isset($this->showList) && is_array($this->showList) && count($this->showList) > 0) { $this->loadShowCustomData(); } } public function loadShows() { $loop = new WP_Query(array( ‘post_type’ => ‘show’, ‘post_parent’ => ‘0’,…Continue reading