Skip to content

Instantly share code, notes, and snippets.

@iamandrewpeters
iamandrewpeters / no-events-message.html
Created December 17, 2018 18:10
No Results Message for BB Post Module
<div style="text-align: center; max-width: 500px; margin: auto; font-size: 24px;">We don't have any events scheduled right now, but you can sign up now to get updates for upcomign events here.</div><br><br>
<div class="button-area"> <div class="hover-over"> <a href="#" target="_blank" rel="noopener">
<div class="more-link"><span class="button-group">Connect Here</span></div></a>
</div>
</div>
@iamandrewpeters
iamandrewpeters / post-layout.html
Created December 19, 2018 16:36
Beaver Builder and Events Cal Layout
<a href="[wpbb post:url]">
<div class="home-event-outer date-layout">
<div class="event-left-item">
<div class="event-item-date">
<span>[wpbb post:the_events_calendar_start_date format="j"]</span>
</div>
<div class="event-item-month">
<span>[wpbb post:the_events_calendar_start_date format="M"]</span>
</div>
</div>
@iamandrewpeters
iamandrewpeters / change-endpoint-titles
Created February 12, 2019 18:32
Change Endpoint titles
/*
* Change the endpoint menu order
*/
function wpb_woo_my_account_order() {
$myorder = array(
'edit-account' => __( 'Change My Details', 'woocommerce' ),
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'members-area' => __( 'My Courses', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
'downloads' => __( 'Your Downloads', 'woocommerce' ),
@iamandrewpeters
iamandrewpeters / ttr-fonts-add.php
Created February 19, 2019 22:10
Change Fonts for TTR
function trc_custom_fonts($system_fonts) {
$system_fonts[ '10K Reasons' ] = array(
'fallback' => 'Verdana, Arial, sans-serif',
'weights' => array(
'300',
'400',
'700',
),
);
return $system_fonts;
@iamandrewpeters
iamandrewpeters / gist:51f907195a95242e7adf525f3d2a1001
Created June 17, 2019 21:29
Register Taxonomies and add to Filter Bar
// Add Campuses Taxonomy
function register_my_taxes_campus() {
$labels = array(
"name" => __( "Campus" ),
"singular_name" => __( "Campus" ),
'new_item_name' => __( 'Add New Campus', 'text_domain' ),
'add_new_item' => __( 'Add New Campus', 'text_domain' ),
@iamandrewpeters
iamandrewpeters / gist:d45e4a47c8f9740f7c6537e5fadffb9f
Created July 31, 2019 16:09
Add Filter to Media with a Taxonomy
// register new taxonomy which applies to attachments
function reach_add_media_taxonomy() {
$labels = array(
'name' => 'Media Type',
'singular_name' => 'Media Type',
'search_items' => 'Search Media Types',
'all_items' => 'All Media Types',
'parent_item' => 'Parent Media Type',
'parent_item_colon' => 'Parent Media Type:',
@iamandrewpeters
iamandrewpeters / CCBPress-gf-param.php
Created August 9, 2019 14:59
CCB Press + Gravity Forms Paremeters
<?php if ( $mailto = $template::get_mailto( $group_profile ) ) : ?>
<div class="ccbpress-group-leader-contact">
<a href="https://rockbridge.cc/full-page-forms/join-a-group/?rb_group_name=<?php echo urlencode( $item->name );?>&group_leader_email=<?php echo urlencode ( $group_profile->main_leader_email );?>&rb_campus_name=<?php echo urlencode ( $group_profile->campus ); ?>" target="_blank">Group Signup</a>
</div>
<?php endif; ?>
// Make sure the ?param-name matches your dynamic population parameter name in the corresponding Gravity Form
//Add Category Selector
add_filter( 'rwmb_meta_boxes', 'cat_select_register_meta_boxes' );
function cat_select_register_meta_boxes( $meta_boxes ) {
$meta_boxes[] = array (
'title' => 'Some Extra Info',
'id' => 'post-purpose-select-title',
'post_types' => array(
0 => 'post',
),
'context' => 'normal',
@iamandrewpeters
iamandrewpeters / faithmade-settings-tweaks.php
Created October 14, 2019 13:29
MB Settings + Customizer
//Register Settings pages for styles and info
add_filter( 'mb_settings_pages', function ( $settings_pages ) {
$settings_pages[] = array(
'id' => 'fm_styles_panel',
'option_name' => 'theme_mods_page-builder-framework',
'menu_title' => 'Style Settings',
'parent' => 'themes.php',
'customizer' => 'true',
);
@iamandrewpeters
iamandrewpeters / fm-settings-setup.php
Created October 16, 2019 19:45
FM Settings Setup
<?php
//Add Settings Pages to Customizer
//Styles Page
add_filter( 'mb_settings_pages', function ( $settings_pages ) {
$settings_pages[] = array(
'id' => 'fm_styles_panel',
'option_name' => 'theme_mods_page-builder-framework',
'menu_title' => 'Style Settings',
'parent' => 'themes.php',
'customizer' => 'true',