Skip to content

Instantly share code, notes, and snippets.

View jrstaatsiii's full-sized avatar

Rich Staats jrstaatsiii

View GitHub Profile
@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
/**
* 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 / 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
@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 / 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 / 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 / product-search-block
Created July 3, 2014 14:46
Product Search Block
<section id="product-search" class="products-search products content-block entry">
<?php if ( get_sub_field('ssm_headline') ) { ?>
<header class="content-block-header">
<?php if ( get_sub_field('ssm_intro_copy') ) { ?>
<div class="intro">
@jrstaatsiii
jrstaatsiii / acf-content-blocks.php
Last active October 3, 2015 21:52
Attempting to insert options into a content block, but only if that content block was selected.
<?php
/**
* Load default choices from options page into content blocks
*/
function acf_load_style_default_choices( $field ) {
// reset choices
$field['choices'] = array();
@jrstaatsiii
jrstaatsiii / content-block-instance.php
Created December 28, 2015 18:37
Get First Instance of Content Block
/*
* Returns the first instance of a given layout option
* @param - $id - the id of the post you are trying to target: '' by default
* @param - $fc_field - the name of the ACF flexible field: 'content_blocks' as the default
* @param - $fc_layout - the name of the flexible content layout: 'visual_editor' as the default
* @return - mixed
* @todo - test different types of returned content. at the moment, I am only using this for returning a string
*/
function get_first_instance_of_content_block( $id = '', $fc_field = 'content_blocks', $fc_layout = 'visual_editor' ) {
<script>
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
if ( formId == 2 && fieldId == 5 ) {
optionsObj.dateFormat = 'mm-dd-yy';
}
return optionsObj;
});
</script>