Skip to content

Instantly share code, notes, and snippets.

View wplit's full-sized avatar
💭
I may be slow to respond.

David Browne wplit

💭
I may be slow to respond.
View GitHub Profile
@wplit
wplit / footer-scripts.html
Last active November 3, 2025 01:18
custom code for programmitically play/pause media player from the outside ( player.paused true/false depending on if player already playing )
@wplit
wplit / footer-scripts.html
Created October 31, 2025 23:33
prevent open accordion item from being closed
@wplit
wplit / code.php
Last active October 29, 2025 00:53
add column to show number of user accounts that have favorited each post (the default 'post' post type) see screenshot in comment below code for end result.
<?php
// Add a custom column to display favorite count of each post
add_filter('manage_post_posts_columns', 'add_favorited_users_column');
function add_favorited_users_column($columns) {
$columns['favorited_users'] = 'Favorited Count';
return $columns;
}
@wplit
wplit / footer-scripts.html
Last active October 24, 2025 04:55
JS functon for sorting columns of dynamic table programmitcally
@wplit
wplit / style.css
Last active October 22, 2025 23:52
Show only the add to cart button in Fluent Carts Buy Section element (add to CSS settings on Buy Section element)
/* hide variant container, quantity, price */
%root% .fc-product-variants,
%root% .fc-product-quantity-container,
%root% .fc-product-item-price {
display: none!important;
}
/*
// optionally hide the buy now button
@wplit
wplit / code-block.js
Last active October 6, 2025 01:08
adding attributes to elements inside carousel builder
jQuery(document).ready(function($) {
let carouselSelector = '.my-carousel'; /* change to class of your carousel element */
/* get the flickity instance to control the carousel */
let $carousel = $(carouselSelector).find($(carouselSelector).children().data('carousel'));
let flkty = $carousel.data('flickity');
// 1. Update aria-current on image as carousel moves -----
@wplit
wplit / footer-scripts.html
Last active September 26, 2025 03:25
change text inside accordion item when expanded/closed
@wplit
wplit / footer-scripts.html
Last active September 26, 2025 00:45
change captions programmatically in Media Player (depending on lang attribute added to html element by Polylang)
@wplit
wplit / footer-scripts.html
Last active September 18, 2025 22:43
download QR Code SVG when button clicked (add to page settings > custom code > footer scripts)
@wplit
wplit / footer-scripts.html
Last active September 16, 2025 01:17
close modal when wpgb rendered new content (ie the filters have been used)