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
Created September 17, 2024 06:27
re-init pro slider when facets are used on slides
@wplit
wplit / video.html
Last active September 15, 2024 11:49
<link rel="stylesheet" href="https://cdn.vidstack.io/player/theme.css" />
<link rel="stylesheet" href="https://cdn.vidstack.io/player/video.css" />
<script src="https://cdn.vidstack.io/player" type="module"></script>
<media-player
playsinline
load="play"
title="Sprite Fight"
src="youtube/_cMxraX_5RE"
@wplit
wplit / footer-scripts.html
Last active September 12, 2024 23:12
prevent any scrolling on read more expand (add to page settings > custom code > footer scripts)
@wplit
wplit / footer-scripts.html
Last active September 11, 2024 01:58
adding margin to header/content/footer on offcanvas open.
@wplit
wplit / footer-scripts.html
Last active September 10, 2024 22:43
initialise pro forms when lightbox opens (add to page settings > custom code > footer scripts)
@wplit
wplit / code.php
Created September 9, 2024 23:35
change wp adjacent post order to be menu order instead of of post date
<?php
function my_previous_post_where() {
global $post, $wpdb;
return $wpdb->prepare( "WHERE p.menu_order < %s AND p.post_type = %s AND p.post_status = 'publish'", $post->menu_order, $post->post_type);
}
add_filter( 'get_previous_post_where', 'my_previous_post_where' );
@wplit
wplit / footer-scripts.html
Last active September 4, 2024 23:24
reset focus back to body element on back to top scrolled
@wplit
wplit / footer-scripts.html
Last active September 3, 2024 06:21
run modal function again when new form appended to the page. (add to page settings > custom code > footer scripts)
@wplit
wplit / footer-scripts.html
Last active September 1, 2024 01:55
Init pro forms when appended inside popover (add to page settings > custom code > footer scripts)
@wplit
wplit / code.php
Last active August 25, 2024 02:10
test element with setting to change attribute, reduced test case
<?php
class X_Test_Element extends \Bricks\Element
{
// Element properties
public $category = "general";
public $name = "xtestelement";
public $icon = "ti-layout-width-full";