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 / 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
@bmoredrew
bmoredrew / full-width-breakout.css
Created January 12, 2018 03:10
Breakout of a parent container
.full-width {
width: 100vw;
position: relative;
left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;
}
@bmoredrew
bmoredrew / WordPress get_the_ID() replacement.md
Created December 14, 2017 16:41 — forked from morganestes/ WordPress get_the_ID() replacement.md
Get the WordPress post ID no matter where you are.

This extends the built-in WordPress function get_the_ID() to return the post ID both inside and outside the loop.

Used outside the loop (in header.php):

<?php if ( function_exists( 'gt_hide_nav' ) && ! gt_hide_nav() ) : ?>
  <nav role="navigation">
    <?php if ( function_exists( 'bones_main_nav' ) ) bones_main_nav(); ?>
  </nav>