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 / 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 / repeatable-fields-metabox.php
Created February 18, 2016 03:44 — forked from helen/repeatable-fields-metabox.php
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
/*
* search an array recursively to find
* the first instance of a key and return its value
*
* useful when you do not know the location of a key nested (only once) in a multidimensional array
*
*/
function array_find_first_recursive($needle_key, array $haystack) {
if (array_key_exists($needle_key, $haystack)) {
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
// Add Favicon
function favicon() {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_template_directory_uri().'/assets/favicon/favicon.ico" />';
}
add_action('wp_head', 'favicon');
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page