Skip to content

Instantly share code, notes, and snippets.

View jesgs's full-sized avatar
🍜
Ramen connoisseur

Jess Green jesgs

🍜
Ramen connoisseur
View GitHub Profile
add_filter("mce_external_plugins", "tomjn_mce_external_plugins");
function tomjn_mce_external_plugins($plugin_array){
$plugin_array['typekit'] = get_template_directory_uri().'/typekit.tinymce.js';
return $plugin_array;
}
@jesgs
jesgs / jesgs-print.css
Last active December 15, 2015 13:28
Print stylesheet from Jes.Gs
/*------------------------------------------------------------------------------
Document : print
Created on : Mar 22, 2013, 7:08:58 PM
Author : Jess Green <jgreen at psy-dreamer.com>
Description: Basic print stylesheet for single posts and pages
------------------------------------------------------------------------------*/
@page {
margin: 1in;
}
SELECT DISTINCT * FROM wp_users u
LEFT JOIN wp_usermeta um ON u.ID = um.user_id
WHERE um.meta_key = 'last_name' ORDER BY um.meta_value ASC;
<?php
define('PLUGIN_PATH', plugin_dir_path(__FILE__));
function my_template_function($id, $size = "", $title = "", $caption = "")
{
$template = locate_template(array('my-theme-template.php'));
$found_template = ($template == '')
? $template
<?php
/**
* WordPress Sandbox
*
* @package WordPress_Sandbox
* @subpackage current-screen-test
* @author Jess Green <[email protected]>
* @version $Id$
*/
<?php
add_filter('gform_field_content', 'add_placeholder_attr', 10, 3);
/**
* Add a placeholder attribute to text inputs
*
* @param string $content
* @param array $field
* @param mixed $value
@jesgs
jesgs / the_title-filter.php
Created October 7, 2013 17:35
The author was lazy today...
<?php
add_filter('the_title', '_correct_empty_title', 10, 2);
/**
* Add snarky filler title for posts without titles
*
* @param string $title WordPress post title
* @param int $id WordPress post ID
* @return string
*/
<?php
add_filter('posts_request', function ($request, $query){
if( ($query->is_main_query() && $query->is_front_page()) && !$query->is_admin) {
return false;
} else {
return $request;
}
}, 10, 2);
<?php
/**
* Modify WP_Query to return taxonomy fields in post array
*
* @author Jess Green <jgreen AT psy-dreamer.com>
*/
add_filter('posts_orderby', 'taxonomy_orderby');
add_filter('posts_fields', 'taxonomy_archive_select_fields');
add_filter('posts_join', 'taxonomy_archive_join');