Skip to content

Instantly share code, notes, and snippets.

// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
@geckoseo
geckoseo / README.md
Created June 27, 2017 21:52 — forked from barneycarroll/README.md
Lock and unlock a page's scroll position.

jquery.scrollLock.js

Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked
$.scrollLock();

// ...or vice versa
@geckoseo
geckoseo / menu_items_remove.php
Created February 21, 2018 14:39
Filters to remove module settings menu panels/views for Beaver Builder / UABB
<?php
/** List of Items
* unset( $views['main']['items'][10] );//Save Layout
* unset( $views['main']['items'][20] );//Duplicate Layout
* unset( $views['main']['items'][30] );//Preview Layout
* unset( $views['main']['items'][35] );//Revisions
* unset( $views['main']['items'][40] );//Separator Line
* unset( $views['main']['items'][50] );//Layout CSS & Javascript
* unset( $views['main']['items'][60] );//Global Settings
<?php
/**
* *whitelabel* Beaver Builder
* Please support Beaver Builder by buying the product at wpbeaverbuilder.com
*/
class FLBuilderWhiteLabel {
public static function is_white_labeled() {
return true;
@geckoseo
geckoseo / functions.php
Created October 29, 2018 13:58 — forked from rilwis/functions.php
Optimize BB for loading
<?php
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'font-awesome' );
wp_dequeue_script( 'jquery-magnificpopup' );
wp_dequeue_style( 'jquery-magnificpopup' );
wp_dequeue_script( 'jquery-waypoints' );
wp_dequeue_script( 'imagesloaded' );
wp_dequeue_script( 'jquery-throttle' );
@geckoseo
geckoseo / functions.php
Last active April 20, 2021 12:37
Toggle Outline of Containers while in Beaver Builder editor with a keyboard shortcut
<?php
/**
* Create Builder Shortcut to highlight containers
*/
add_filter( 'fl_builder_keyboard_shortcuts', function( $shortcuts ) {
$shortcuts['outlineObjects'] = array(
'label' => __( 'Outline Objects'),
'keyCode' => 'mod+q' //shortcut is Ctrl+q or Cmd+q - Change this to anything that works best for you
@geckoseo
geckoseo / fbclid-nginx.conf
Last active April 13, 2020 19:31
SpinupWP Nginx Configs - Strip fbclid query string from url when page is linked to from Facebook
######################
# Consists of 2 parts
######################
# Part 1 - first snippet (map) needs to go before the server block
# create a custom config file in /etc/nginx/sites-available/{DOMAIN}/before
# remove fbclid argument from the end of the url
map $request_uri $redirect_fbclid {
"~^(.*?)([?&]fbclid=[a-zA-Z0-9_-]+)$" $1;
@geckoseo
geckoseo / functions.php
Last active May 27, 2020 21:24
Beaver Themer - show a Gutenberg Block using conditional logic if an ACF date field is in the future.
//Events In This Program
function program_events()
{
ob_start(); // start buffer
$documents = get_posts(array(
'post_type' => 'events',
'meta_query' => array(
array(
'key' => 'program', // name of custom field
'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234"