Skip to content

Instantly share code, notes, and snippets.

@pmgllc
pmgllc / kill-emoji.php
Created April 22, 2016 13:09
Kill emoji support in WordPress
<?php
//* Deregister WP 4.2 Emoji Support
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
@pmgllc
pmgllc / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am pmgllc on github.
  • I am jpetersen (https://keybase.io/jpetersen) on keybase.
  • I have a public key whose fingerprint is D957 C060 7B64 8FE3 F232 64E5 3ED1 1735 7DFD 3079

To claim this, I am signing this object:

@pmgllc
pmgllc / content_limit_tags.php
Created July 3, 2014 18:07
Allow HTML tags in content limit
<?php
add_filter( 'get_the_content_limit_allowedtags', 'get_the_content_limit_custom_allowedtags' );
/**
* @author Brad Dalton
* @example http://wp.me/p1lTu0-a5w
*/
function get_the_content_limit_custom_allowedtags() {
// Add custom tags to this string
return '<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>';
@pmgllc
pmgllc / google-fonts-script.php
Last active August 29, 2015 13:57
Google Fonts for Genesis framework
<?php
//* Load Google fonts
add_action( 'wp_enqueue_scripts', 'pmg_load_google_fonts' );
function pmg_load_google_fonts() {
wp_enqueue_style(
'google-fonts',
'http://fonts.googleapis.com/css?family=Merriweather|Open+Sans',
array(),
CHILD_THEME_VERSION
@pmgllc
pmgllc / remove_taxonomy.php
Created January 30, 2014 21:10
remove taxonomy pre_get_posts()
<?php
add_action('pre_get_posts', 'remove_issue_date_tax' );
function remove_issue_date_tax( $wp_query ) {
global $wp_query;
if( is_page( 'blog' ) ) {
get_query_var('tax', '-', 'issue-date');
}
}
@pmgllc
pmgllc / filter-out-taxonomy.php
Created January 30, 2014 20:36
It won't return any results without an ID or a slug... is there something other than taxonomy to lay out here?
<?php
// Unhook Genesis Loop and use custom loop
remove_action( 'genesis_loop', 'genesis_do_loop');
add_action( 'genesis_loop', 'not_issues_loop');
function not_issues_loop() {
global $wp_query;
$args = array(
'posts_per_page' => 20,
'post_type' => 'post',
@pmgllc
pmgllc / featured-image.php
Created January 30, 2014 16:25
Pull a featured image with custom size into a page template - #genesiswp
@pmgllc
pmgllc / trial.js
Created January 10, 2014 15:48
It likes this one.
<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery('#Submit').click(function() {
var splitName = jQuery('#Contact0FirstName').val();
var names = splitName.split(' ');
var firstName = names.splice(0,1);
var lastName = names.join(' ');
jQuery('#Contact0FirstName').val(firstName);
jQuery('#Contact0LastName').val(lastName);
jQuery('form').submit();
@pmgllc
pmgllc / name_split.js
Created January 10, 2014 15:43
When do you run this on a page/form to split the name field before it posts to Infusionsoft?
<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery('#Submit').click(function() {
var splitName = jQuery('#Contact0FirstName').val();
var names = splitName.split(' ');
var firstName = names.splice(0,1);
var lastName = names.join(' ');
jQuery('#Contact0FirstName').val(firstName);
jQuery('#Contact0LastName').val(lastName);
jQuery('form').submit();