Skip to content

Instantly share code, notes, and snippets.

View jrstaatsiii's full-sized avatar

Rich Staats jrstaatsiii

View GitHub Profile
@jrstaatsiii
jrstaatsiii / flexcontent.php
Last active July 10, 2016 21:42
Example Flexible Content Field Group
<?php
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'group_5436e219da3a2',
'title' => 'Layout Builder',
'fields' => array (
array (
'key' => 'field_5436e27cb585e',
'label' => 'Content Blocks',
@jrstaatsiii
jrstaatsiii / function-hellobar.php
Last active January 7, 2017 04:58
SSM Hello bar with ACF / Foundation6
<?php
add_action ('genesis_before', 'ssm_do_hellobar');
/**
* Create Hellobar
*
*/
function ssm_do_hellobar() {
if ( get_field('show_global_message') == 'Yes' && get_field('global_message', 'options') != NULL ) {
{
"key": "group_5888f0f081f23",
"title": "Page Builder",
"fields": [
{
"key": "field_5888f0f5a2760",
"label": "Content Blocks",
"name": "content_blocks",
"type": "flexible_content",
"instructions": "<strong>Content Blocks<\/strong> are horizontal rows of content containing one or more columns.",
@jrstaatsiii
jrstaatsiii / pricing-plan-template.php
Created May 9, 2017 21:14
Template Tag for SSM Pricing Tables
<?php
function pricing_plan_template( $plan, $display = 'full', $pricing_table_id ) {
$features = get_field('features', $pricing_table_id); // list or curated
if ( $features == 'list') {
$available_features = get_field('standard_feature_list', $pricing_table_id);
$standard_features = $plan['standard_features'];
@jrstaatsiii
jrstaatsiii / portfolio-grid.php
Last active September 6, 2017 19:25
Portfolio Grid
<?php
$args = array(
'post_type' => 'case-study',
'post_status' => 'publish',
'facetwp' => true,
'ssm' => true
);
$query = new WP_Query( $args );
@jrstaatsiii
jrstaatsiii / do-navigation.php
Created August 23, 2017 17:34
ssm_do_navigation
<?php
function ssm_do_navigation( $location = 'header' ) {
$menu = '';
$depth = '';
$items_wrap = '';
if ( $location == 'header' ) {
$default_menu = get_field('default_primary_navigation', 'options');
@jrstaatsiii
jrstaatsiii / carbonfields.php
Created December 19, 2017 02:58
Quick Example of how we might organize our Carbon Fields setup
<?php
add_action( 'init', 'ssm_remove_post_type_support' );
function ssm_remove_post_type_support() {
remove_post_type_support( 'page', 'editor' );
}
add_action( 'after_setup_theme', 'crb_load' );
<?php
// Conditional Itinerary Builder Template
$form_page = get_option('form_page');
$suggestions_page = get_option('suggestions_page');
$results_page = get_option('results_page);
if ( is_page( $form_page ) ) {
get_template_part('/templates/form-page');
<?php
// Bail if section is set to inactive
if ( get_sub_field('status') == 0 )
return;
global $tpl_args;
$s_classes = array('faqs-template');
@jrstaatsiii
jrstaatsiii / svgnav.html
Last active July 6, 2018 00:58
SVG Image Navigation
<nav class="primary-navigation">
<ul class="logo-menu">
<li class="menu-item">
<a href="#">
<span class="hide-on-medium">Brand One</span>
<img class="show-on-medium" src="/path/to/img.svg" aria-label="Brand One Logo" alt="Brand One Logo" />
</a>
</li>
<li class="menu-item">
<a href="#">