Skip to content

Instantly share code, notes, and snippets.

View JohnBunka's full-sized avatar
🎯
Focusing

John Bunka JohnBunka

🎯
Focusing
View GitHub Profile
@JohnBunka
JohnBunka / fuctions.php
Created February 6, 2020 17:26
Fix images using CloudFlare hotlink protection and Beaver Builder
// The first URL is your actual URL. The second is your CDN url.
add_filter( 'fl_builder_render_css', function( $css ) {
$css = str_replace( 'https://pressavenue.com/', 'https://your.cdn.com/', $css );
return $css;
});
@JohnBunka
JohnBunka / functions.php
Created March 20, 2019 20:24
Link Font Awesome from hosted CDN
//enqueues our external font awesome stylesheet
function enqueue_our_required_stylesheets(){
wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/5.7.2/css/font-awesome.min.css');
}
add_action('wp_enqueue_scripts','enqueue_our_required_stylesheets');
@JohnBunka
JohnBunka / functions.php
Created March 20, 2019 20:23
Load Font Awesome Locally
//enqueues our locally supplied font awesome stylesheet
function enqueue_our_required_stylesheets(){
wp_enqueue_style('font-awesome', get_stylesheet_directory_uri() . '/css/font-awesome.css');
}
add_action('wp_enqueue_scripts','enqueue_our_required_stylesheets');
@JohnBunka
JohnBunka / functions.php
Created March 5, 2019 03:55
Cleanup URL in Beaver Builder for CSS Purposes - Press Avenue
//Beaver Builder - Replace your actual URL with the CDN URL for CSS purposes
// You would adjust the URLs to fit your URLs. The first URL is your actual URL. The second is your CDN url.
add_filter( 'fl_builder_render_css', function( $css ) {
$css = str_replace( 'https://pressavenue.com/', 'https://your-amazing-cdn-uwl-here.com/', $css );
return $css;
});
@JohnBunka
JohnBunka / posts.php
Last active October 2, 2019 13:55
Current Date Shortcode - Beaver Builder Theme
Shortcode Example
[fl_year] 2018
[fl_year format="y"] 18
[fl_year format=“F j, Y”] May 26, 2018
[fl_year format=“l, F j, Y”] Saturday, May 26, 2018
[fl_year format=“m-d-Y”] 05-25-2018
[fl_year format=“n-j-y”] 5-25-18
[fl_year format=“d.m.y”] 25.05.18
@JohnBunka
JohnBunka / posts.php
Created May 14, 2018 16:00
Beaver Builder Current Date Shortcode
[fl_year]
@JohnBunka
JohnBunka / functions.php
Last active April 19, 2018 18:38 — forked from woogists/wc-remove-tabs.php
Remove the additional information tab only
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
}
@JohnBunka
JohnBunka / functions.php
Created April 11, 2018 17:11
WooCommerce - Removing Tabs
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
}
@JohnBunka
JohnBunka / functions-plugin.php
Created October 12, 2017 22:54
Move the Yoast SEO Meta Box to the Bottom of the edit screen in WordPress
/*-------------------------------------
Move the Yoast SEO Meta Box to the Bottom of the edit screen in WordPress
---------------------------------------*/
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@JohnBunka
JohnBunka / additional-or-custom-css.css
Last active October 2, 2017 16:36
How to create a fixed Top Bar Menu in Beaver Builder
/*
Add this to the Additional CSS area in the customizer or to the style.css in your child theme - More info and help at www.PressAvenue.com
or on the blog post https://pressavenue.com/create-fixed-top-bar-menu-beaver-builder
*/
.fl-page-bar {
position: fixed;
width: 100%;
z-index: 999;
}
.fl-page-header-fixed {