Skip to content

Instantly share code, notes, and snippets.

View mchavezi's full-sized avatar
🎯
Focusing

Michael A Chavez mchavezi

🎯
Focusing
View GitHub Profile
@mchavezi
mchavezi / taxonomy-category.php
Last active August 29, 2015 14:17
Taxonomy Nested Categories
<?php
/*
* Template Name: Acme Category Landing
*/
get_header();
function acme_get_logo( $term ) {
$img = get_field('category_image_src' , $term->taxonomy . '_' . $term->term_id );
@mchavezi
mchavezi / gist:69df79dbd96d619926d5
Created April 1, 2015 23:06
Display one post per taxonomy with WordPress Genesis Framework
<?php
// Add our custom loop
add_action( 'genesis_loop', 'one_post_per_tax_loop' );
function one_post_per_tax_loop() {
$terms = get_terms( 'sets' );
foreach ( $terms as $term ) {
$args = array(
'tax_query' => array(
array(
@mchavezi
mchavezi / gist:d746d78aca30b79974c5
Last active August 29, 2015 14:18
Display one post per taxonomy with WordPress Genesis Framework
<?php
// Add our custom loop
add_action( 'genesis_loop', 'one_post_per_tax_loop' );
function one_post_per_tax_loop() {
$terms = get_terms( 'sets' );
foreach ( $terms as $term ) {
$args = array(
'tax_query' => array(
array(
@mchavezi
mchavezi / gist:352df135276bfaffc872
Created April 1, 2015 23:46
Naked Markup for Genesis Grid
<!-- First Article -->
<div class="feature">
<h2 class="entry-title">
<a rel="bookmark" href="http://localhost/plosfoo/site1/multiple-paragraph-post/">Multiple Paragraph Post</a>
</h2>
<div class="post-info">
<span class="date published time" title="2015-03-26T22:26:40+00:00">March 26, 2015</span>
by
<span class="author vcard">
@mchavezi
mchavezi / gist:d0da516fd6b6fe910744
Created April 8, 2015 23:36
One Post From Each Category
<?php
$categories = get_categories();
foreach ( $categories as $category ) {
$args = array(
'cat' => $category->term_id,
'post_type' => 'post',
'posts_per_page' => '1',
);
$query = new WP_Query( $args );
@mchavezi
mchavezi / gist:9c5cd3544344ae6052b2
Created April 10, 2015 17:53
Category List Templage Genesis
<?php
/*
Template Name: Category List
*/
?>
<?php
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'category_post_loop');
function category_post_loop() {
@mchavezi
mchavezi / gist:d732eb2177df90570d03
Created July 14, 2015 19:45
can this be made better? of course!
<?php
/*
Template Name: Category List
*/
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'category_post_loop');
function category_post_loop() {
$args = array(
@mchavezi
mchavezi / Elm Gulp Config
Created October 20, 2015 18:11
Gulp file for compiling multiple Elm files.
var Path = require('path');
var Gulp = require('gulp');
var Elm = require('gulp-elm');
var Concat = require('gulp-concat');
var Newer = require('gulp-newer');
Gulp.task('elm-init', Elm.init);
Gulp.task('elm', ['elm-init'], function () {
@mchavezi
mchavezi / gist:b32174eecc9ec82ef24f
Created November 21, 2015 04:08 — forked from trevorgerhardt/gist:40e944e63dee3ee1779f
Script for Macs when file limit is hit when building large projects with component
echo 'kern.maxfiles=20480' | sudo tee -a /etc/sysctl.conf
echo 'limit maxfiles 8192 20480\nlimit maxproc 1000 2000' | sudo tee -a /etc/launchd.conf
echo 'ulimit -n 4096' | sudo tee -a /etc/profile
@mchavezi
mchavezi / mongolab import command
Created December 30, 2015 01:43
command to import json file into mongolab database collection.
mongoimport -h ds037155.mongolab.com:37155 -d <databasename> -c <collectionname> -u <username> -p <password> --file <nameofjsonfile.json> --jsonArray