Skip to content

Instantly share code, notes, and snippets.

View tomfinitely's full-sized avatar

Tom Finley tomfinitely

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / template-menu.php
Created April 13, 2017 16:48
ACF-Based Restaurant Menu Template
<?php
/*
Template Name: Restuarant Menu Template2
*/
add_action( 'genesis_before_loop', 'my_restaurant_menu' );
function my_restaurant_menu () {
//My ACF Fields for reference
@tomfinitely
tomfinitely / gulpfile.js
Created August 3, 2017 20:12
SEOThemes Studio Pro Replacement Gulp SASS Output
/**
* Compile Sass.
*
* https://www.npmjs.com/package/gulp-sass
*/
gulp.task( 'styles', function () {
gulp.src( paths.styles )
// Notify on error
@tomfinitely
tomfinitely / reset-acf-metabox.php
Created September 7, 2017 15:48
Reset ACF Metabox Positions
function prefix_reset_metabox_positions(){
delete_user_meta( 1, 'meta-box-order_post' );
delete_user_meta( 1, 'meta-box-order_page' );
delete_user_meta( 1, 'meta-box-order_custom_post_type' );
}
add_action( 'admin_init', 'prefix_reset_metabox_positions' );