Skip to content

Instantly share code, notes, and snippets.

View askwpgirl's full-sized avatar

Angela Bowman askwpgirl

View GitHub Profile
@askwpgirl
askwpgirl / custom.js
Created April 11, 2025 22:14
Flipbox script for click custom flipbox in Elementor
<script>
(function($) {
function setupFlipBoxes($scope) {
$scope.find('.custom-flip-box').each(function () {
const $flipBox = $(this);
$flipBox.off('click').on('click', function () {
$flipBox.toggleClass('flipped');
});
});
}
@askwpgirl
askwpgirl / style.css
Created April 9, 2025 14:46
CSS for Elementor to Respect Reduced Motion
/* This is a CSS media query for accessibility-aware
** browsers respects reduced motion setting in operating systems */
@media (prefers-reduced-motion: reduce) {
.elementor-motion-effects-element[style] {
transform: none !important;
}
}
@askwpgirl
askwpgirl / style.css
Last active April 8, 2025 21:24
Elementor Accessibile Hyperlinks and Hover State
/* Add this CSS to your Custom CSS in Site Settings
** or custom.css */
/* Underline hyperlinks in text widgets */
.elementor-widget-text-editor a {
text-decoration: underline;
}
.elementor-widget-text-editor a:hover {
@askwpgirl
askwpgirl / pause-sliders.js
Created April 8, 2025 19:44
Add Pause Button to Elementor Carousels
//Add this to Header/Footer plugin in the HTML <head>
<script>
document.addEventListener('DOMContentLoaded', function () {
const seen = new WeakSet();
const interval = setInterval(() => {
const swiperEls = document.querySelectorAll('.swiper.swiper-initialized');
swiperEls.forEach((swiperEl, index) => {
if (seen.has(swiperEl)) return;
@askwpgirl
askwpgirl / gist:5daf4c7e8b6e43b952df6d71dd2a32ca
Created February 27, 2025 01:40
CSS for Elementor's broken lightbox styles
/* Elementor's Site Settings for Lightbox icon colors
has been broken for a long time.
You can use the code below in your custom CSS to control
the icon colors */
.elementor-slideshow__header,
.elementor-lightbox .dialog-lightbox-close-button,
.elementor-lightbox .elementor-swiper-button {
color: #000 !important;
}
@askwpgirl
askwpgirl / robots.txt
Last active February 2, 2025 16:39
Robots.txt for The Events Calendar
The Events Calendar can drive up huge amoounts of CPU by generating tons of worthless URLs that bots try to call.
Following is a robots.txt file that can combat these excessive server hits from Google and Facebook bots.
Note, this also blocks The Events Calendar Categories which you may or may not want to do.
User-agent: *
Crawl-delay: 3
Disallow: /wp-login.php
Disallow: /trackback
Disallow: /feed
@askwpgirl
askwpgirl / gist:b6658d29f377b41e600cf737359c4274
Created February 1, 2025 18:09
Fix Elementor Mobile Display on Post Widget with Left Positioned Image
/* Text content disappears on post widgets that have a left-aligned image,
unless the image ratio is adjusted to be very tiny on mobile.
To stack the image instead, use this CSS in the Customizer. */
@media(max-width: 767px) {
.elementor-posts-container.elementor-has-item-ratio .elementor-post__thumbnail img {
left: auto !important;
position: relative !important;
top: auto !important;
transform: none !important;
@askwpgirl
askwpgirl / functions.php
Last active October 18, 2024 18:24
Dequeue errant The Events Calendar Elementor Template CSS
// TEC tries to load its auto generated Elementor "Starter" template CSS on every event.
// This CSS file will throw a 404 since it will never be used on any event under any circumstance.
// To prevent this, use the following function in your child theme's functions file or Code Snippet plugin.
// Change the template ID to the ID of the template under Templates > Saved Templates > The Events Calendar – Starter
// You cannot delete this template as TEC will auto generate it again.
// This CSS is enqueued in TEC free plugin - src > Events > Integrations > Plugins > Elementor > Asset_Manager.php
function dequeue_elementor_event_template_styles_on_single_event() {
// Check if this is a single event page
if ( is_singular('tribe_events') ) {
@askwpgirl
askwpgirl / functions.php
Created September 22, 2024 02:32
WooCommerce - Add Short Description to Product Archives
<?php
// Add the following to Code Snippets after creating ACF Field for the short description
// apply the ACF field group to Products posts
/*-------------------------------------------------------*/
/* Add short description to product archives
/*-------------------------------------------------------*/
function my_excerpt_in_product_archives() {
@askwpgirl
askwpgirl / functions.php
Created May 3, 2024 21:42
Add category body class to The Events Calendar category archives
<?php
add_filter( 'body_class', 'tec_archive_body_class' );
function tec_archive_body_class( array $classes ) {
if (is_tax( 'tribe_events_cat' ) ) {
$classes[] = 'rg-events-category';
}