Skip to content

Instantly share code, notes, and snippets.

View baerkins's full-sized avatar
🌵

Shaun Baer baerkins

🌵
  • Philadelphia, PA
View GitHub Profile
@baerkins
baerkins / settings.local.php
Last active November 13, 2018 21:01
Local Drupal 8 Settings
<?php
/**
* SAVE FILE TO:
* `[PROJECT_BASE]/web/sites/default`
*
*/
/**
* Enable local development services.
@baerkins
baerkins / development.services.local.yml
Created November 13, 2018 21:00
Local Development Services
# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
auto_reload: true
cache: false
@baerkins
baerkins / modal.css
Last active August 24, 2018 19:56
Accessible Modal with JS
body.is-locked {
height: 100%;
overflow: hidden;
}
.modal {
display: none;
}
.modal--is-open {
@baerkins
baerkins / auto-gen-taxonomy-term.php
Last active February 6, 2018 14:24
Auto-generate a taxonomy term when a post is created
<?php
/**
* Auto Gen Project Agency Taxonomy when an agency is created
* @link https://gist.githubusercontent.com/brenna/7377802/raw/a5092e5b4bd2a094a6534d73e9f2f81f26783744/wp-autopopulate-taxonomy
*
*/
function FS__Update_Project_Agency_Terms($post_id) {
// Only update terms if it's the post type we want
<?php
namespace Apollo\Extend\TribeEvents;
// Functions to extend the Events Calendar plugin
// https://theeventscalendar.com/
// Note: it's a rag tag bunch of functions, use are your own risk.
/**
<?php
/**
* Custom Gravity Forms Spinner
*
* @since 1.0.0
*/
add_filter( 'gform_ajax_spinner_url', 'spinner_url', 10, 2 );
function spinner_url( $image_src, $form ) {
<?php
// Add ACF Options Menu
if ( function_exists("acf_add_options_page") ) {
acf_add_options_page();
}
if ( function_exists("register_options_page") ) {
register_options_page( 'Global Options' );
register_options_page( 'Page Options' );
}
@baerkins
baerkins / yoast
Created June 29, 2017 13:09 — forked from aderaaij/yoast
Wordpress - Move yoast seo boxes to bottom of post/page
// Move Yoast to bottom
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@baerkins
baerkins / calendar.md
Last active June 28, 2017 14:09
Tribe Event Calendar Content Options

Calendar Event Content Options

There are many variables at play when events are created. This is a list of content pieces that Tribe Events can output by default:

Basic Data

  • Title
  • Content
  • Featured Image
  • Event Category
  • Tags
@baerkins
baerkins / sidebar_taxonomy_term_list.php
Created April 10, 2014 17:39
This gist creates a list of custom taxonomy terms in Wordpress. - It will display the child terms of a the current taxonomy term that is being viewed. - If the term being viewed is a child term, it will show the child terms of its parent. - The children of other terms will be hidden.
<?php
// List Custom Taxonomy Terms Based on Current View
// Setup global variables
$current_taxonomy = 'project_status';
$current_term_id = get_queried_object()->term_id;
$terms = get_terms($current_taxonomy);
// For a Single Post, get the ID of each term used