Skip to content

Instantly share code, notes, and snippets.

@bmoredrew
bmoredrew / .zshrc
Created November 16, 2022 21:02 — forked from zanshin/.zshrc
My .zshrc file
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#export ZSH_THEME="robbyrussell"
export ZSH_THEME="zanshin"
@bmoredrew
bmoredrew / breadcrumbs-list.php
Created August 26, 2022 20:23 — forked from doubleedesign/breadcrumbs-list.php
Mark up Yoast breadcrumbs as an unordered list
<?php
/**
* Filter the output of Yoast breadcrumbs so each item is an <li> with schema markup
* @param $link_output
* @param $link
*
* @return string
*/
function doublee_filter_yoast_breadcrumb_items( $link_output, $link ) {
@bmoredrew
bmoredrew / mandarin-wide-card-template.html
Created July 4, 2022 17:56
BC Mandarin Theme - Wide Card Template
<div class="wide-card">
<div class="wide__content">
<div class="wide__content-inner" style="text-align:left;">
<h3 style="color: #fff; text-align:left;">
GIFT CERTIFICATE
</h3>
<p style="color: #fff;">
Give the perfect gift every time
</p>
<a href="/card-link" class="button button--primary button--white">
@bmoredrew
bmoredrew / mandarin-faq-template.html
Created July 4, 2022 17:51
BC Mandarin Theme - FAQ Template
<section class='section-accordion'>
<div class='section__accordion js-accordion'>
<div class='accordion-item js-accordion-item'>
<h4 class='accordion__title js-accordion-head'>
What is CBD?
</h4>
<div class='accordion__content js-accordion-body'>
<p>CBD is a chemical found in marijuana. CBD doesn't contain tetrahydrocannabinol (THC), the psychoactive ingredient found in marijuana that produces a high. The usual CBD formulation is oil, but CBD is also sold as an extract, a vaporized liquid and an oil-based capsule. Food, drinks and beauty products are among the many CBD-infused products available online.</p>
</div>
@bmoredrew
bmoredrew / sort-by-acf-repeater-field.php
Last active May 7, 2022 08:15
Sort Posts by ACF Repeater Field Using Multidimensional Array
<?php
// Create an empty array for storage
$post_data = array();
// Set arguments for your query
$args = array(
'post_type' => 'trips',
'posts_per_page' => 999
);
@bmoredrew
bmoredrew / gist:dcc7d04b23e785f6c0bb
Created April 27, 2015 15:56
Front-end Attendee List WooCommerce WooTickets Events Calendar Plugin
<?php
global $current_user;
get_currentuserinfo();
if (is_user_logged_in() && $current_user->ID == $post->post_author) {
// Build a list of attendees
$attendeeList = TribeEventsTickets::get_event_attendees($event_id);
$customerList = array();
@bmoredrew
bmoredrew / index.php
Last active April 2, 2019 18:06 — forked from lepittenger/index.php
Check if the_content is empty
<?php
if ( $post->post_content=="" )
{
// do something for posts without content
}
else
{
// do something for posts with content
};
.opened ul#mobile_menu {
max-height: 400px;
height: 400px;
overflow-y: scroll;
}
<?php
/*
Plugin Name: Sizeable Whitelist Login
Author: Sizeable Interactive
Author URI: https://www.sizeableinteractive.com
Version: 0.1
Description: Server agnostic plugin to white list WordPress login screen to IP addresses using a self-authenticating secret URL.
**** NOTE ***
You must define the SZBL_SECRET_LOGIN_URL or set a login URL in the settings page for this plugin to take affect.
// Margin and padding classes
// -------------------------
=box-model($direction, $type, $amount, $multiplier)
.#{str-slice($type, 1, 1) + $direction}-#{$amount * $multiplier}
@if $direction == ""
#{$type}: ($amount * $multiplier + px) !important
@if $direction == "t" or $direction == "y"
#{$type}-top: ($amount * $multiplier + px) !important