Skip to content

Instantly share code, notes, and snippets.

View gbissland's full-sized avatar

Gareth Bissland gbissland

View GitHub Profile
@neilgee
neilgee / functions-selectwoo.php
Last active May 29, 2019 04:49
Style Default Select Form Elements Using Selectize JS
<?php // <~ don't add me in
add_action('wp_enqueue_scripts', 'my_select_dropdown');
function my_select_dropdown() {
if( is_shop() || is_product_category() ) {
wp_enqueue_style( 'select2');
wp_enqueue_script( 'selectinit', get_stylesheet_directory_uri() . '/js/select2-init.js', array( 'selectWoo' ), '1.0.0', true );
@mikejolley
mikejolley / functions.php
Last active November 8, 2022 00:25
WooCommerce 3.3 - Hide uncategorized category from the shop page on the frontend
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_product_subcategories_args', 'custom_woocommerce_product_subcategories_args' );
function custom_woocommerce_product_subcategories_args( $args ) {
$args['exclude'] = get_option( 'default_product_cat' );
return $args;
@carlosonweb
carlosonweb / bb-clickble-col.js
Last active December 21, 2023 19:38
Make a BB Column Clickable
/**
* Makes a BB Column clickable.
* Pre-requisite: There must be an A Tag contained within the column element.
*/
(function($){
// Exit if BB layout is in edit mode.
if ( 'undefined' != typeof window.FLBuilderConfig ) {
return;
}
@carasmo
carasmo / remove-google-fonts-add-default-fonts-beaver-builder.php
Last active April 17, 2019 17:18
How to add only the theme font choices and remove the Google fonts from Beaver Builder. See the image in the comment.
<?php
//don't add again
// Save Time? Consider a donation via PayPal @ me@christinacreativedesign.com
add_action( 'wp_head', 'childprefix_beaver_builder_modifications', 0 );
/*
* Beaver Builder Builder Enabled Modifications
@carlosonweb
carlosonweb / bt-sticky-on-mobile.js
Created November 17, 2017 03:17
Beaver Themer -- Set Header Layout to be Sticky on Mobile
jQuery(document).ready(function($){
if ( typeof window.FLBuilderConfig === 'undefined' || window.FLBuilderConfig === null ) {
$('header.fl-builder-content').addClass('fl-sticky-on-mobile')
}
});
/**
* The CSS for fl-sticky-on-mobile
@media (max-width:992px){
@carlosonweb
carlosonweb / bb-nav-menu-hover-to-click.php
Last active October 14, 2024 05:45
On Beaver Builder Theme, prevent the Navigation Menu from displaying submenu items on hover and instead do it on click.
<?php
add_action('wp_footer', function(){
if ( is_admin() ) return;
?>
<script id="remove-menu-hover">
jQuery(document).ready(function($){
setTimeout(function(){
$('nav.fl-page-nav ul.navbar-nav > li.menu-item-has-children').off('mouseenter mouseleave');
$('nav.fl-page-nav ul.navbar-nav > li.menu-item-has-children > a').on('click', function(event){
event.preventDefault();
@carlosonweb
carlosonweb / wp-configs-snippets.php
Last active March 25, 2023 19:12
Recommended wp-config.php snippets for Beaver Builder
<?php
// Recommended for BB
define('WP_MEMORY_LIMIT', '512M');
define('FL_BUILDER_MODSEC_FIX', true);
// Enable Debugging
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
// Etc
@psahalot
psahalot / menu-logo.php
Created September 22, 2017 08:51
Logo in Advanced Menu module
function pp_add_logo_before_menu() {
echo '<a href="your-website-url"><img src="logo-url" /></a>';
}
add_action('pp_advanced_menu_before', 'pp_add_logo_before_menu');
@helgatheviking
helgatheviking / functions.php
Last active May 6, 2019 00:15
Add Beaver Builder Support to Storefront Child Theme
<?php
function remove_page_header_for_builder() {
if( is_page_template( 'template-builder.php' ) ) {
remove_action( 'storefront_page', 'storefront_page_header' );
}
}
add_action( 'storefront_page_before', 'remove_page_header_for_builder' );