Skip to content

Instantly share code, notes, and snippets.

View tomfinitely's full-sized avatar

Tom Finley tomfinitely

View GitHub Profile
@tomfinitely
tomfinitely / program-page-sidebar.php
Last active March 21, 2017 20:51
Genesis Simple Sidebar Conditional
<?php
// Remove the Primary Sidebar from the Primary Sidebar area.
add_action( 'genesis_after_header', 'su_change_genesis_primary_sidebar' );
function su_change_genesis_primary_sidebar() {
$inova_sidebar = get_field( 'inova_sidebar' );
if( is_active_sidebar( 'program-page-sb' ) ) {
@tomfinitely
tomfinitely / flexible-fields.php
Last active November 8, 2016 19:42
ACF Flexible Single Page Builder
/*---------------------------------------------------*/
/* Flexible Single Pages */
/*---------------------------------------------------*/
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array (
'key' => 'group_550f4c3fb623b',
'title' => 'Flexible Content',
'fields' => array (
@tomfinitely
tomfinitely / page_flexible.php
Created November 8, 2016 19:41
Genesis Flexible ACF Pages
<?php
/**
* Genesis Framework.
*
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
* Please do all modifications in the form of a child theme.
*
* @package Genesis\Templates
* @author StudioPress
* @license GPL-2.0+
@tomfinitely
tomfinitely / acf-ms-taxonomy-field-v5.php
Created October 6, 2016 15:11
ACF Multisite Taxonomy Field (5.0+)
<?php
class acf_ms_taxonomy extends acf_field
{
/*
* __construct
*
* This function will setup the field type data
*
@tomfinitely
tomfinitely / acf-ms-taxonomy-field-v4.php
Last active October 6, 2016 15:10
ACF Multisite Taxonomy Select (4.0 and lower)
<?php
class acf_ms_taxonomy extends acf_field
{
var $defaults;
/*
* __construct
@tomfinitely
tomfinitely / Contract Killer 3.md
Created August 15, 2016 16:14
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@tomfinitely
tomfinitely / functions.php
Last active July 29, 2016 17:26 — forked from srikat/functions.php
Related Posts with Thumbnails in Genesis with fix for removing duplicate Posts. https://sridharkatakam.com/related-posts-with-thumbnails-in-genesis-reloaded/
add_action( 'genesis_before_comments', 'sk_related_posts', 12 );
/**
* Outputs related posts with thumbnail
*
* @author Nick the Geek
* @url http://designsbynickthegeek.com/tutorials/related-posts-genesis
* @global object $post
*/
function sk_related_posts() {
@tomfinitely
tomfinitely / gist:e93b2c3eff30e0ee94d3ded11fec00d9
Created June 10, 2016 20:44
WordPress Advanced Custom Field (ACF) - Conditional Checkboxes with Labels as Output (with option of Values as URLs)
//* Program Locations
$program_locations = get_field( 'program_locations' );
if ( $program_locations ) {
echo '<section class="location-widget widget widget_text"><div class="wrap widget-wrap">';
echo '<h4 class="widget-title widgettitle">Program Locations</h4>';
$field = get_field_object('program_locations');
@tomfinitely
tomfinitely / gist:908d182fc7f010f03962e53407614b40
Created June 10, 2016 20:42
WordPress Advanced Custom Field (ACF) - Repeater with Conditional Subfields
//* Program Faculty
$faculty = get_field('faculty_listing');
if( have_rows('faculty_listing') ) :
echo '<section class="row" id="faculty"><div class="wrap"><h4>Faculty</h4><div class="faculty">';
while( have_rows('faculty_listing') ): the_row();
@tomfinitely
tomfinitely / su-multiple-post-thumbs.php
Created October 30, 2015 16:03
SU Multiple Post Thumbnails
//* Featured Events Secondary Featured Image
if (class_exists('MultiPostThumbnails')) {
new MultiPostThumbnails(array(
'label' => 'Featured Image 2',
'id' => 'featured-image-2',
'post_type' => 'su_feat_events'
) );
}