Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Meagher nickmeagher

View GitHub Profile
@nickmeagher
nickmeagher / functions.php
Created Jan 12, 2018
Add Wishlist to "My Account" Page
View functions.php
<?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' );
@nickmeagher
nickmeagher / jquery-bootstrap-datepicker.css
Last active Apr 17, 2020 — forked from miwahall/jquery-bootstrap-datepicker.css
jQuery UI Datepicker Bootstrap 3 Style
View jquery-bootstrap-datepicker.css
.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 Mar 3, 2016
Add taxonomy parent to the body class
View functions.php
/**
* 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 / functions.php
Created Mar 3, 2016
Taxonomy Term Template Children Inheritance - Children terms inherit the parent taxonomy template.
View functions.php
/**
* 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.