Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / add-custom-taxonomies-to-tec.php
Created December 8, 2018 19:21
Add Custom Taxonomies to The Events Cal Filter Bar
// Add custom taxonomies to Filter bar
if (class_exists('Tribe__Events__Filterbar__Filter')):
class Tribe__Events__Filterbar__Custom extends Tribe__Events__Filterbar__Filter {
public $type = 'select';
public function get_admin_form() {
$title = $this->get_title_field();
$type = $this->get_multichoice_type_field();
return $title.$type;
}
@iamandrewpeters
iamandrewpeters / description-shortcode.html
Last active October 31, 2018 17:29
Description of Shortcode for Staff Email
//How Conditional Shortcodes work to diplay this
[wpbb-if some-field-connection-shortcode]
<a href="[some-field-connection-shortcode]">my email icon</a>
[/wpbb-if]
[wpbb-if post:acf type='url' name='church_information_staff_email']
<a href="mailto:[wpbb post:acf type='url' name='church_information_staff_email']"><span class="fas fa-envelope-open"></span></a>
[/wpbb-if]
//What we have here is a Beaver Builder shortcode that is conditional.
@iamandrewpeters
iamandrewpeters / staff-post-layout.html
Created October 31, 2018 15:51
Staff Area for Beaver Builder Posts
/* Make Sure to replace my ACF shortcodes with your own*/
[wpbb-if post:featured_image]
<div class="pp-custom-grid-post-image">
[wpbb post:featured_image size="large" display="tag" linked="no"]
</div>
[/wpbb-if]
<div class="pp-custom-grid-post-text">
<h2 class="post-title">[wpbb post:title]</h2>
@iamandrewpeters
iamandrewpeters / login-customization.php
Last active October 18, 2018 15:11
Change Login Logo and URL
//Login Page Customization
//Add the Logo
function reach_login_logo() { ?>
<style type="text/css">
#login h1 a, .login h1 a {
background-image: url(#); //Replace the # with your image's URL
height:65px;
width:320px;
background-size: 320px 65px;
@iamandrewpeters
iamandrewpeters / another-reach-co-welcome-widget.php
Last active October 18, 2018 14:10
Create a Welcome Widget in the Dashboard
//Add Welcome Widget
//Register the Widget
function reachco_welcome_metabox() {
// Get the current logged in user.
$current_user = wp_get_current_user();
// Grab the users first name.
$name = $current_user->user_firstname;
@iamandrewpeters
iamandrewpeters / acf-avatar
Created October 14, 2018 23:22
Use ACF image field as an Avatar
// Use ACF image field as avatar
//Have to create a User image field
add_filter('get_avatar', 'acf_profile_avatar', 10, 5);
function acf_profile_avatar( $avatar, $id_or_email, $size, $default, $alt ) {
// Get user by id or email
if ( is_numeric( $id_or_email ) ) {
$id = (int) $id_or_email;
$user = get_user_by( 'id' , $id );