Skip to content

Instantly share code, notes, and snippets.

Kellen Mace kellenmace

Block or report user

Report or block kellenmace

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kellenmace
kellenmace / functions.php
Created Mar 10, 2015
trivium enqueue scripts
View functions.php
function trivium_enqueue_scripts() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() .'/style.css' );
// Use is_page_template() conditional so this only loads on page-results.php and single-event.php
wp_enqueue_script( 'google-maps', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false' );
wp_enqueue_script( 'trivium-scripts', get_stylesheet_directory_uri() .'/js/trivium-scripts.js', array( 'jquery', 'google-maps' ) );
// jQuery DataTables scripts & styles for Results
if ( is_page( 'Results' ) || is_page( 'Event List' ) ) {
wp_enqueue_style( 'datatables-css', '//cdn.datatables.net/1.10.4/css/jquery.dataTables.css' );
View trivium-scripts.js
$(document).ready(function(){
// Render ACF Google Map
$('.acf-map').each(function(){
render_map( $(this) );
});
// Set up jQuery DataTables
if ( $( '#event-results' ).dataTable || $( '#event-list-container' ).dataTable ) {
View template-tags.php
function trivium_build_calendar_events() {
$events_query = new WP_Query( array(
'post_type' => 'event',
'order' => 'ASC'
) );
if ( $events_query->have_posts() ) {
$calendar_events = array();
View facebook-conversion-pixel.php
elseif ( is_admin() ) {
/**
* Include plugin options page
* @since 1.0
*/
include_once( plugin_dir_path( __FILE__ ) . 'includes/admin.php' );
/**
* Include Custom Metaboxes and Fields Library
* @since 1.2
@kellenmace
kellenmace / Force CSS Changes to “go live" Immediately
Created Apr 8, 2015
Force CSS Changes to “go live” Immediately
View Force CSS Changes to “go live" Immediately
wp_enqueue_style( 'stylesheet-name', get_stylesheet_directory_uri() . '/style.css' . '?' . filemtime( get_stylesheet_directory() . '/style.css' ), );
@kellenmace
kellenmace / Force CSS Changes to “go live” Immediately
Created Apr 8, 2015
Force CSS Changes to “go live” Immediately
View Force CSS Changes to “go live” Immediately
wp_enqueue_style( 'stylesheet-name', get_stylesheet_directory_uri() . '/style.css' . '?' . filemtime( get_stylesheet_directory() . '/style.css' ) );
View gist:96711cc329e589fdc444
Getting started on an existing project:
boot up vvv
get database dump file from DevOps engineer - Jason DeWitt
use site wizard to create a new site using this flag:
-db followed by the local database file to import (or import via Sequel Pro later on)
clone the repo into the appropriate directory
if you want to download the media from the live site, add this code to the site’s vvv config file (vvv-local > config > nginx-config > sites > nameoflocalsite.conf):
---------------------------------------
Directives to send expires headers and turn off 404 error logging.
View appfoliowebsite
appfoliowebsite.dev
supertest.appfoliowebsite.dev
statestreet_blueandtan.appfoliowebsite.dev
demo-statestreet-sfr1.appfoliowebsite.dev
demo-statestreet-mfr2.appfoliowebsite.dev
demo-statestreet-mfr1.appfoliowebsite.dev
oceanblueproperties.appfoliowebsite.dev
cityproperties.appfoliowebsite.dev
demo-statestreet-com1.appfoliowebsite.dev
demo-altavista-sfr3.appfoliowebsite.dev
View wp-config.php
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
View rewrite.php
<?php
namespace IOCDF;
/**
* Rewrite post URLs that have a /news/%postname%/ structure
*/
function rewrite_post_urls() {
add_rewrite_rule('^blog/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/?', 'index.php?/blog/year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&postname=$matches[4]', 'top');
You can’t perform that action at this time.