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 15, 2024 23:45
make sure readmore reset when tabs switched
@wplit
wplit / footer-scripts.html
Last active November 15, 2024 06:22
refresh Bricks' query loop on button click
@wplit
wplit / code.php
Last active November 12, 2024 05:42
example code for creating a new column to display number of times a post was favorited by logged in users.
<?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
Created November 12, 2024 04:03
prev/next for pro tabs
@wplit
wplit / footer-scripts.html
Last active November 6, 2024 03:35
push whole site to right when offcanvas open.
@wplit
wplit / code.js
Last active November 2, 2024 05:35
Run Bricksextras functions
let container = document /* document if re-running for all the page content, otherwise use the element that is being loaded in via ajax */
/* Pro Accordion */
if ( typeof doExtrasAccordion == 'function') {
doExtrasAccordion(container)
}
/* Pro Slider */
if ( typeof doExtrasSlider == 'function') {
doExtrasSlider(container)
@wplit
wplit / footer-scripts.html
Last active October 29, 2024 22:17
open the modal unless user has closed with the close button
@wplit
wplit / code-block.js
Last active October 28, 2024 02:20
run custom code each time new content is appended to page by infinite scroll
jQuery(document).ready(function($) {
let infiniteScollerSelector = '#-infinite-scroller-2484-245'; /* ID of infinite scroller element */
/* listen for append.infiniteScroll event */
$(infiniteScollerSelector + ' .oxy-dynamic-list').on( 'append.infiniteScroll', function() {
/* code inside here that will run when the content is appended */
@wplit
wplit / footer-scripts.html
Created October 23, 2024 00:37
force browser resize 1 second after content loaded.
@wplit
wplit / footer-scripts.html
Last active October 16, 2024 22:18
click specific toggle switch label based on a class found on the <main> element