Skip to content

Instantly share code, notes, and snippets.

/* ========================================================================
// Multi Select
// ========================================================================*/
/* ------------------------------------------------------------------------
// Sortable
// ------------------------------------------------------------------------*/
function multiSelectSortableAfterInit(that, container){
function acf_form_field_load( $field ) {
$field['choices'] = array();
$forms = RGFormsModel::get_forms( null, 'title' );
$field['choices'][''] = '- Select Form -';
foreach ( $forms as $form ) {
$field['choices'][ $form->id ] = $form->title;
}
return $field;
}
@christianmagill
christianmagill / figure.css
Created May 24, 2016 01:03
Make figure and figcaption the same width.
figure { display: table; }
figcaption { display: table-caption; caption-side: bottom ; }
function createFunctionWithTimeout(callback, opt_timeout) {
var called = false;
function fn() {
if (!called) {
called = true;
callback();
}
}
setTimeout(fn, opt_timeout || 1000);
return fn;
if fetch(:stage) == 'production'
set :application, 'example.com'
else
set :application, 'staging.example.com'
end
set :repo_url, '[email protected]:example/example.com.git'
# Branch options
# Prompts for the branch name (defaults to current branch)
@christianmagill
christianmagill / cpt-archive-for-taxonomy.php
Created September 23, 2016 01:34
Use a WordPress Custom Post Type Archive for a Given Taxonomy
add_filter('template_include', function(){
if(is_tax('taxonomy-name'))
$template = get_query_template('archive-post-type');
return $template;
});
@christianmagill
christianmagill / reveal-scrollbar-fix.css
Last active March 31, 2019 21:38
Fixes page jump issue with Foundation 6 Reveal component.
body.is-reveal-open {
overflow: visible;
}
.reveal-overlay {
overflow-y: hidden;
}
@christianmagill
christianmagill / Foundation6-TabToAccordion.js
Created October 26, 2016 23:00 — forked from danrcoull/Foundation6-TabToAccordion.js
Foundation 6 - Convert Tabs to Accordion on small Screens.
## Description Add the below To any Foundation 6 theme and change the iniialUlClass to whatever your tab ul class is.
## Author : Daniel Coull <ttechitsolutions@gmail.com>
var tabsToAccordian = {
initialUlClass: '.easytabs',
accordian: null,
tabs:null,
# deploy.rb from https://github.com/roots/bedrock-capistrano modified by FEW Agency, https://github.com/fewagency/
# FEW-comment: from Capistrano doc:
# Here we'd set the name of the application, must be in a format that's safe for
# filenames on your target operating system.
set :application, 'APPLICATIONNAME'
# FEW-comment: use the SSH url for the repo from GitHub
set :repo_url, '[email protected]:USER/REPO.git'
.banner{
position: relative;
// height: 33.1vw;
overflow: hidden;
}
.banner img{
display: none;
width: 100%;