This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creates a timestamped report file (e.g., redirect_verification_report_20250415_120530.txt) | |
Records all failures, timeouts, and errors in the report file | |
Includes detailed information about each issue | |
Adds a summary section at the end of the report | |
Automatically deletes the report file if all redirects work correctly (no failures or errors) | |
Provides a clear message about where to find the report if issues are detected | |
When you run this script: | |
If everything works perfectly, you'll see a success message and no report file will be created |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Password Peek | |
* | |
* Add focus toggle script to password-protected pages, so when the password field is focused, it will show the password. | |
* | |
* @package PDXWLF | |
*/ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global Constants to use throughout the script | |
const pageTitle = document.title; | |
const pageUrl = window.location.href; | |
window.addEventListener('load', () => { | |
//## FORMS ### | |
const forms = document.querySelectorAll('form:not([data-type="search"])'); | |
if([...forms].length > 0){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); | |
$year = get_query_var('year'); | |
$posts_args = array( | |
'post_type' => 'coverage', | |
'posts_per_page' => -1, // Show all posts | |
'orderby' => 'date', | |
'order' => 'DESC', | |
'date_query' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//** Custom Post Type Archive Rewrite Rules **// | |
function custom_news_rewrite_rules($rules) { | |
$new_rules = [ | |
'company/news-room/media-coverage/([0-9]{4})/?$' => 'index.php?post_type=coverage&year=$matches[1]', | |
'our-news/([0-9]{4})/?$' => 'index.php?post_type=news&year=$matches[1]' | |
]; | |
// This places your new rule at the top of the array to ensure it has priority. | |
return $new_rules + $rules; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CREATE A PICTURE ELEMENT FROM AN ACF IMAGE FIELD, IF DATA IS either an array or URL | |
TO DO: | |
- pass src set for truly responsive images using the ID as the ACF data. | |
*/ | |
// Check for .webp existence | |
function webp_exists($image_url) { | |
$upload_dir = wp_upload_dir(); | |
$relative_path = str_replace($upload_dir['baseurl'], '', $image_url); | |
$webp_path = $upload_dir['basedir'] . $relative_path . '.webp'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function auto_select_gift() { | |
if ( is_single(56669) ) { //enter product id here | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function ($) { | |
document.getElementById("gifting_0_option").click(); // Click on the checkbox | |
}); | |
</script> | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Search for : (.*(\n|$)){2} | |
alt+R - to toggle regular expression search | |
alt+ENTER - to select all results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** SCRIPTS FOR DESIGNATING WHEN ITEMS ARE LIKED, STORING THAT PREFERENCE, | |
AND LOADING THOSE PREFERENCES UPON PAGE REFRESH **/ | |
/** when you click on a featured heart, make it liked **/ | |
$(".solution_item .liked_status").click(function(){ | |
// create a variable that references the containing parent of heart just clicked | |
const self = $(this).parent(); | |
// create a variable that contains just the ID of the parent element | |
const likedToolID = self.attr("id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Add tracking pixel if order contains product ID. Replace 11747 with your specific product ID */ | |
add_action( 'woocommerce_thankyou', 'bundleTracking' ); | |
function bundleTracking(){ | |
/* do nothing if we are not on the appropriate page */ | |
if( !is_wc_endpoint_url( 'order-received' ) || empty( $_GET['key'] ) ) { | |
return; | |
} |
NewerOlder