This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enable SVG Uploads in Beaver Builder Modules | |
add_filter( 'fl_module_upload_regex', function( $regex, $type, $ext, $file ) { | |
$regex['photo'] = '#(jpe?g|png|gif|bmp|tiff?|svg)#i'; | |
return $regex; | |
}, 10, 4 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Removes Slugs from CPT URLs | |
function na_remove_slug( $post_link, $post, $leavename ) { | |
if ( 'linked_article' != $post->post_type || 'publish' != $post->post_status ) { | |
return $post_link; | |
} | |
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="event-wrapper"> | |
<a class="event-link" href="[wpbb post:url]"> | |
<div class="event-date-outer-wrapper mobilehide"> | |
<div class="event-date-wrapper"> | |
<div class="event-month"> | |
[wpbb post:the_events_calendar_start_date format='M'] | |
</div> | |
<div class="event-day"> | |
[wpbb post:the_events_calendar_start_date format='j'] | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////////// Snippets from Behind the Site March 2022 ////////// | |
// Add to the functions.php of your active child theme or a custom functions plugin | |
/////////////// WooCommerce Modifications /////////////// | |
//Show FREE rather than $0.00 | |
//Source: https://www.businessbloomer.com/woocommerce-display-free-instead-0-00-empty-price/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***************** CSS from Behind The Site, March 2022 *****************/ | |
/* Typography */ | |
.fl-rich-text p { /* Removes Kadence top p margin */ | |
margin-top:0 !important; | |
} | |
.fl-rich-text p:last-child { /*removes margin at bottom of BvB text modules */ | |
margin-bottom: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('*').forEach(el => { | |
if (el.offsetWidth > document.documentElement.offsetWidth) { | |
console.log('Hold Up - This Guy Sucks ->: ', el); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide The Events Calendar Fields in Admin | |
add_action('admin_head', 'bww_hide_tec_field_groups'); | |
function bww_hide_tec_field_groups() { | |
echo '<style> | |
#event_tribe_venue,#event_tribe_organizer,#event_url,#event_cost {display:none !important;} | |
</style>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add Kadence Dashboard Widget | |
function ni_register_kadence_dashboard_widget() { | |
wp_add_dashboard_widget( | |
'custom_dashboard_widget', | |
'Welcome to Your Website', //Title for Dashboard Widget | |
'ni_custom_dashboard_widget_content' | |
); | |
} | |
function ni_kadence_dashboard_widget_content() { | |
echo do_shortcode('[kadence_element id="104"]'); //Add your shortcode here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RESTRICT CONTENT - Disable signup fee for renewals. | |
// This is for debugging - do not use if you're just looking at my gists. | |
function ag_rcp_disable_signup_fee_renewals( $fee_args, $registration ) { | |
// Bail if this isn't a signup fee. | |
if ( 'Signup Fee' != $fee_args['description'] && 'Signup Credit' != $fee_args['description'] ) { | |
return $fee_args; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: My Awesome Custom Functions Plugin | |
Plugin URI: https://nathaningram.com | |
Description: A set of custom functions for client websites from Nathan Ingram's Page Builder Developer Course Nov 2020 | |
Version: 1.0 | |
Author: Nathan Ingram | |
Author URI: https://nathaningram.com | |
License: GPL2 | |
*/ |