Skip to content

Instantly share code, notes, and snippets.

View joetower's full-sized avatar

Joe Tower joetower

View GitHub Profile
@joetower
joetower / rsync-things.txt
Created May 19, 2019 22:23
rsync exclude-from txt file
rsync -avz --exclude-from 'exclude-list.txt'
@joetower
joetower / flexible-content.php
Created October 14, 2016 16:10
WordPress flexible content include example
<?php
/**
* ACF fields for pages using this template parent - page.flexible.php
*
*/
?>
<?php
// check if the flexible content field has rows of data
?>
<?php if( have_rows('page_content_group') ):?>
@joetower
joetower / content-page-full.php
Created October 14, 2016 16:08
WordPress content page full example
<?php
/**
* The template used for displaying page content
*
* @package WordPress
* @subpackage Twenty_Sixteen
* @since Twenty Sixteen 1.0
*/
?>
@joetower
joetower / page-flexible.php
Last active October 14, 2016 16:01
WordPress flexible template page template example.
<?php
/**
* Template Name: Flexible Page Template
* // This template uses ACF and full-width featured image
*/
get_header(); ?>
<div id="primary" class="content-area">
// Small handheld collpased navigation
(function ($) {
'use strict';
$(document).ready(function () {
var pullNav = $('#pull-nav');
var menu = $('.secondary-links');
var pullSideMenu = $('#pull-side-one');
var menuSidebar = $('#sidebar-left');
@joetower
joetower / block--bean--bundle_name.tpl.php
Created August 5, 2013 16:02
Drupal Bean Block Template Example
<?php
/**
* @file
* Default theme implementation for entities.
*
* Available variables:
* - $content: An array of comment items. Use render($content) to print them all, or
* print a subset such as render($content['field_example']). Use
* hide($content['field_example']) to temporarily suppress the printing of a
@joetower
joetower / The Grangles
Created July 11, 2013 17:06
CSS snippets I use frequently.
/* REMOVE WEBKIT CSS NONSENSE */
input,
textarea,
input:focus,
textarea:focus {
-webkit-appearance:none;
-webkit-box-sizing:border-box;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
@joetower
joetower / Drupal Nonsense
Last active May 23, 2018 12:46
Preprocess and template snippets related to front-end theming stuff.
Preprocess
// Slideshow wrapper to allow absolute placement of slideshow content//
function theme-name_preprocess_views_view_fields(&$vars, $hook){
if ($vars['view']->name == 'slideshow') {
$vars['fields']['title']->wrapper_prefix = '<div class="slideshow-content-wrapper">' . $vars['fields']['title']->wrapper_prefix;
$vars['fields']['field_slide_button_link']->wrapper_suffix .= '</div>';
}
}