Skip to content

Instantly share code, notes, and snippets.

View jrstaatsiii's full-sized avatar

Rich Staats jrstaatsiii

View GitHub Profile
@jrstaatsiii
jrstaatsiii / genesis_markup
Last active August 29, 2015 14:02
Is there a better way to filter Genesis structural class names?
<?php
/*
* How do I append a class "row" to the class "site-header" as opposed to recreating "site-header" like I am here?
*
*/
add_filter( 'genesis_attr_site-header', 'ssm_site_header' );
/*
* Add the appropriate foundation class to site-header
*
@jrstaatsiii
jrstaatsiii / acf.php
Created December 10, 2013 15:25
Provide a list of usernames who can edit custom field definitions here
function remove_acf_menu()
{
// provide a list of usernames who can edit custom field definitions here
$admins = array(
'admin',
'jrstaatsiii'
);
// get the current user
@jrstaatsiii
jrstaatsiii / gist:7736698
Created December 1, 2013 16:55
Issue with ACF Post Object
<?php if ( get_field('ssm_featured_course', 'options') ) { ?>
<?php $post_object = get_field('ssm_featured_course', 'options'); ?>
<?php $post = $post_object; ?>
<?php setup_postdata( $post ); ?>
<div id="featured-course">
<div class="wrap">
@jrstaatsiii
jrstaatsiii / 0_reuse_code.js
Created October 15, 2013 02:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/**
* Use an img tag for the logo
* @param $title
* @param $inside
* @param $wrap
*
* @return string
*/
function ssm_modify_site_title_html( $title, $inside, $wrap ) {
@jrstaatsiii
jrstaatsiii / Tri.be Event List
Created July 15, 2013 17:04
Tri.be Event List
<div class="event-wrap">
<div class="upcoming-events">
<h3>Upcoming Events</h3>
<ul class="events">
<?php
@jrstaatsiii
jrstaatsiii / gist:5877221
Last active December 19, 2015 01:39
setTimeout to reconfigure the viewport
jQuery(document).ready(function($){ // so as to wait for any CSS-effecting assets to download
setTimeout(function() { // prepare the timeout
if(location.hash){ // is there a location hash?
if($(location.hash)){ // is there an element with an id that matches the location hash?
// determine the x location of the element we want to be in the viewport
var targetTop = $('#content').offset().top;
@jrstaatsiii
jrstaatsiii / gist:5876225
Last active December 19, 2015 01:29
Woothemes Testimonials Plugin Code Snippet
do_action( 'woothemes_testimonials', array(
'tax_query' => array(
array(
'taxonomy' => 'testimonial-category',
'field' => 'id',
'terms' => array( $testimonial_id )
)
),
'limit' => 1,
@jrstaatsiii
jrstaatsiii / windells-mce.css
Created December 6, 2012 15:54
Windells My Custom Event CSS
/** these are additions or replacements to the existing elements **/
div.page {overflow:hidden;} /** base.css line 35 **/
/** can we make the overall width match our site? 960px. It seems to hold up when I test in the browser **/
/** update the #title-area width to 186px **/
#title-area {width: 186px;} /** client.css line 13 **/
/** update the background color to #f1f2f2 **/
div.page_wrapper {background-color: #f1f2f2;} /** base.css line 56 **/
@jrstaatsiii
jrstaatsiii / cat-to-body
Created October 11, 2012 15:45
Add Category To Body Class
add_filter('body_class','add_category_to_single');
function add_category_to_single($classes, $class) {
if (is_single() ) {
global $post;
foreach((get_the_category($post->ID)) as $category) {
// add category slug to the $classes array
$classes[] = $category->category_nicename;
}
}
// return the $classes array