Skip to content

Instantly share code, notes, and snippets.

View nickmeagher's full-sized avatar

Nick Meagher nickmeagher

View GitHub Profile
@nickmeagher
nickmeagher / functions.php
Created March 3, 2016 04:22
Taxonomy Term Template Children Inheritance - Children terms inherit the parent taxonomy template.
/**
* Filter the taxonomy hierarchy to inject a parent level of templates.
*
* @param string $template The current template.
* @return string Filtered taxonomy template.
*/
function new_tax_hierarchy( $template ) {
$term = get_queried_object();
// If not an object, or the object doesn't have a taxonomy, bail.
@nickmeagher
nickmeagher / functions.php
Created March 3, 2016 16:32
Add taxonomy parent to the body class
/**
* Add taxonomy parent to the body class
*
* @param array $classes The current classes.
* @return array New array with updated classes
*/
function body_class_add_parent_taxonomy( $classes ) {
if ( is_tax() ) {
$taxonomy = get_queried_object();
@nickmeagher
nickmeagher / jquery-bootstrap-datepicker.css
Last active April 17, 2020 18:17 — forked from miwahall/jquery-bootstrap-datepicker.css
jQuery UI Datepicker Bootstrap 3 Style
.ui-datepicker {
background-color: #fff;
border: 1px solid #66AFE9;
border-radius: 4px;
box-shadow: 0 0 8px rgba(102,175,233,.6);
display: none;
margin-top: 4px;
padding: 10px;
width: 240px;
}
@nickmeagher
nickmeagher / functions.php
Created January 12, 2018 21:42
Add Wishlist to "My Account" Page
<?php
/*
* Register new wishlist endpoint
*/
function primer_add_wishlist_endpoint() {
add_rewrite_endpoint( 'wish-list', EP_ROOT | EP_PAGES );
}
add_action( 'init', 'primer_add_wishlist_endpoint' );