Skip to content

Instantly share code, notes, and snippets.

View lepittenger's full-sized avatar

Lauren Levin (Pittenger) lepittenger

View GitHub Profile
@alexstandiford
alexstandiford / tailwind.config.js
Created August 27, 2021 17:54
WordPress theme.json that extends Tailwind CSS configs
const fs = require( 'fs' )
const themeJson = fs.readFileSync( './theme.json' )
const theme = JSON.parse( themeJson )
const colors = theme.settings.color.palette.reduce( ( acc, item ) => {
const [color, number] = item.slug.split( '-' )
// If there is a number identifier, make this an object
if(undefined !== number) {
<?php
/**
* Set the number of posts on the Custom Post Type archive for `fe_recipe` to 5.
*/
add_action( 'pre_get_posts', 'fe_modify_number_of_posts_per_page' );
/**
* Modify Posts Per Page for CPT `fe_recipe`
*
@JPry
JPry / cmb2_sample.js
Last active February 21, 2019 13:31
A Sample CMB2 metabox with fields that show/hide based on other fields. In action: http://screencast.com/t/sXJ9rpOS
// Either create a new empty object, or work with the existing one.
window.JPry_CMB2 = window.JPry_CMB2 || {};
(function( window, document, $, app, undefined ) {
'use strict';
// Cache specific objects from the DOM so we don't look them up repeatedly.
app.cache = function() {
app.$ = {};
app.$.select = $( document.getElementById( 'jpry_sample_selection' ) );
@gregrickaby
gregrickaby / wdsjQuery.js
Last active April 2, 2021 19:37
WDS Javascript Style
/**
* file: wdsjQuery.js
*
* Handle Foo things for the foo theme.
*/
window.wdsFoo = {};
( function( window, $, app ) {
// Private variable.
var fooVariable = 'foo';
@theeventscalendar
theeventscalendar / Renaming calendar views.php
Last active February 22, 2016 23:11 — forked from anonymous/view-change-tec-391.php
Renames Calendar Views
// We want to adapt the names of views listed within the Tribe Events Bar
add_filter( 'tribe-events-bar-views', 'rename_tribe_views_in_selector', 100 );
function rename_tribe_views_in_selector( $views ) {
// This lists the original view names you wish to change along
// with the substitutes to wish to use in their place
$to_change = array(
'List' => 'All Events',
'Month' => 'Calendar',
'Photo' => 'Picture Board',
<?php
/*
Filter pmpro_has_membership_access based on paid membership access.
*/
function my_pmpro_has_membership_access_filter( $hasaccess, $mypost, $myuser, $post_membership_levels ) {
$my_paid_level_ids = array(5,6,7);
// Check if the user doesn't have access
if( ! $hasaccess ) {
// If this post has membership levels associated with it and is supposed to be locked by the Addon Plugin
@spivurno
spivurno / gw-gravity-forms-post-content-merge-tags-usage.php
Last active November 4, 2019 14:00
Gravity Wiz // Add Support for Gravity Form Merge Tags in your Post Content (when an entry ID is passed)
<?php
# Basic
gw_post_content_merge_tags();
# With Parameters
gw_post_content_merge_tags( array(
'auto_append_eid' => false,
'encrypt_eid' => true
) );
@chsh
chsh / fa-icon-external-link.css
Created April 9, 2012 05:32
Show icon after external link using Font Awesome