Skip to content

Instantly share code, notes, and snippets.

View amberhinds's full-sized avatar

Amber Hinds amberhinds

View GitHub Profile
@amberhinds
amberhinds / fix-plugin-header-level.js
Created April 10, 2025 16:48
Change a H5 with a specific ID to an H2 instead
// Get the <h5> element with the ID #plugin-block-heading1
const h5Element = document.getElementById('plugin-block-heading1');
if (h5Element) {
// Create a new <h2> element
const h2 = document.createElement('h2');
// Copy the content of the <h5> to the <h2>
h2.innerHTML = h5Element.innerHTML;
@amberhinds
amberhinds / footer.js
Created April 2, 2025 21:30
Add a span with aria-current to breadcrumb current page.
@amberhinds
amberhinds / footer.js
Created February 28, 2025 19:39
Fix Max Mega Menu toggle buttons to have a true button adjacent to the link
@amberhinds
amberhinds / footer.js
Last active January 29, 2025 03:28
Add Main tag with correct ID if missing to fix broken skip links in Elementor
@amberhinds
amberhinds / FixEDDReturnKeyOnCheckout.JS
Created August 26, 2024 21:46
Code that restores the ability for keyboard only users to trigger links and buttons on EDD checkout pages when using the Payment Elements experience.
/**
* Fix broken return key on checkout page.
*
* THIS IS A TEMPORARY FIX TILL EDD FIXES THE ISSUE.
*
* Edd has a stripe script that binds to the entire document and runs
* preventDefault on the return key. This is a temporary fix to allow
* the return key to work on the checkout page.
*/
export const checkoutFixBrokenReturnKey = () => {
@amberhinds
amberhinds / style.css
Created June 26, 2024 15:41
Position Elementor Slides Pause Button Bottom Right
selector #pause-button-0 {
position: absolute;
bottom:5px;
right: 5px;
z-index: 999;
}
@amberhinds
amberhinds / functions.php
Created April 12, 2024 14:47
Remove posts in category from blog archive
/** Remove shorts category from the blog **/
add_filter( 'pre_get_posts', 'amber_exclude_shorts_category' );
function amber_exclude_shorts_category ( $query ) {
if ( $query->is_home && ! is_admin() ) {
$query->set( 'cat', '-272' );
}
return $query;
}
@amberhinds
amberhinds / functions.php
Created April 11, 2024 17:53
How to remove all rules of type from Accessibility Checker
function my_rule_type_filter($rules){
$rules = edac_remove_element_with_value($rules, 'rule_type', 'warning'); // Removes all warnings
return $rules;
}
add_filter('edac_filter_register_rules','my_rule_type_filter');
@amberhinds
amberhinds / functions.php
Created April 11, 2024 17:49
How to remove a specific rule from Accessibility Checker Scans
function my_rule_filter($rules){
$rules = edac_remove_element_with_value($rules, 'slug', 'slider_present'); // Replace the slug with the slug of the rule you want to remove.
return $rules;
}
add_filter('edac_filter_register_rules','my_rule_filter');
@amberhinds
amberhinds / functions.php
Last active April 9, 2024 15:09
edac_max_alt_length Accessibility Checker filter example
function change_max_alt_length( $max ) {
return 100; // Shorten alt text max character count to 100 from default (300).
}
add_filter( 'edac_max_alt_length', 'change_max_alt_length' );