Skip to content

Instantly share code, notes, and snippets.

View puredazzle's full-sized avatar

chris andersson puredazzle

View GitHub Profile
@puredazzle
puredazzle / acf-parent-template-rule.php
Last active September 7, 2018 08:41
Advanced Custom Fields: Location rule for query page by parent parent template. – https://www.advancedcustomfields.com/resources/custom-location-rules/
<?php
add_filter('acf/location/rule_types', function($choices) {
$choices['Page']['parent_template'] = 'Page Parent Template';
return $choices;
});
add_filter('acf/location/rule_values/parent_template', function($choices) {
$templates = wp_get_theme()->get_page_templates();
$choices = array_merge($choices, $templates);
@puredazzle
puredazzle / webpack.mix.js
Last active December 21, 2018 06:25
Advanced Laravel Mix setup for WordPlate - https://github.com/wordplate/wordplate
const mix = require('laravel-mix');
const resources = 'resources/assets';
const themePath = 'public/themes/wordplate';
const assetsPath = `${themePath}/assets`;
mix.setPublicPath(assetsPath);
mix.setResourceRoot('../');
mix.browserSync({