Skip to content

Instantly share code, notes, and snippets.

Avatar
🍜
Ramen connoisseur

Jess Green jesgs

🍜
Ramen connoisseur
View GitHub Profile
View typekit.editor.php
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 Dec 15, 2015
Print stylesheet from Jes.Gs
View jesgs-print.css
/*------------------------------------------------------------------------------
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;
}
View WordPress users ORDERY BY last_name example
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;
View template-extend.php
<?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
View custom-views-wordpress.php
<?php
/**
* WordPress Sandbox
*
* @package WordPress_Sandbox
* @subpackage current-screen-test
* @author Jess Green <jgreen@psy-dreamer.com>
* @version $Id$
*/
View placeholder-gravityforms.php
<?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 Oct 7, 2013
The author was lazy today...
View the_title-filter.php
<?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
*/
View main-query-disable.php
<?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);
@jesgs
jesgs / composer.json
Created Mar 3, 2014
Example composer.json file for add WordPress as a dependency to a project.
View composer.json
{
"repositories": [
{
"type": "package",
"package": {
"name": "wordpress",
"type": "webroot",
"version": "3.8.1",
"dist": {
"type": "zip",
View wordpress-gallery.php
You can’t perform that action at this time.