Skip to content

Instantly share code, notes, and snippets.

@robneu
robneu / single-pets.php
Created February 3, 2013 02:56
A page template for displaying a single pet custom post type.
<?php
/**
* The custom pets post type single post template
*/
/** Remove Default Genesis Sidebar */
add_action( 'get_header', 'pet_init', 20 );
function pet_init() {
remove_action('genesis_sidebar', 'ss_do_sidebar');
@robneu
robneu / single-pets-meta.php
Last active December 12, 2015 02:38
An inefficient section of a page template
<?php
/** Return the first taxonomy term name */
function strays_tax_terms( $taxonomy, $term ) {
global $post;
$terms = get_the_terms( $post->ID, $taxonomy );
$term = array_pop($terms);
if ( !is_wp_error( $term ) ) {
return $term->name;
}
}
@robneu
robneu / wp-config
Created February 26, 2013 20:48
Set your GF license key in wp-config
/** Define Gravity Forms License Key */
define("GF_LICENSE_KEY", "YOUR-LICENSE-KEY-HERE");
/* Theme Name: Quattro Child Theme Theme URI: http://www.studiopress.com/themes/quattro
Description: Quattro is a two or three column child theme created for the Genesis Framework.
Author: StudioPress Author URI: http://www.studiopress.com/
Version: 1.0
Tags: black, blue, brown, gray, green, orange, pink, purple, red, silver, tan, white, yellow, dark, light,
one-column, two-columns, three-columns, left-sidebar, right-sidebar, fixed-width, custom-background, custom-header,
custom-menu, featured-images, full-width-template, post-formats, sticky-post, theme-options, threaded-comments
Template: genesis
Template Version: 1.8.2
@robneu
robneu / eightcrazy.css
Last active December 14, 2015 18:39
Responsive edit for eightcrazy
@media only screen and (max-width: 1200px) {
#header .widget-area {
width: 580px;
}
.menu-primary a,
.menu-secondary a,
#header .menu a {
padding: 15px;
<?php
/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a
* loop through a CPT archive
*/
/** Remove Post Info */
remove_action('genesis_before_post_content','genesis_post_info');
@robneu
robneu / gist:5197450
Created March 19, 2013 16:11
Remove the default CSS for a landing page template
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
add_action( 'genesis_meta', 'landing_page_css' );
/**
* Remove the default stylesheet and replace with landing.css.
*
* @author Robert Neu
* @since 1.0.0
*/
function landing_page_css() {
echo '<link rel="stylesheet" href="'. get_stylesheet_directory_uri() .'/landing.css" type="text/css" media="screen" />'."\n";
@robneu
robneu / wordpress-mu-plugin-urls.php
Last active December 15, 2015 15:09
This code will help you get the URLs for a plugin inside WordPress Must Use directory. This makes it easy for you to use them throughout your plugin in order to reference things like CSS and JavaScript files.
<?php
/**
* Define URLs for a Must Use Plugin
* Remember to change EXAMPLE to your plugin prefix
*
* @author FAT Media <http://youneedfat.com>
* @copyright Copyright (c) 2013, FAT Media
* @license GPL-2.0+
*/
@robneu
robneu / scripts.php
Last active December 15, 2015 15:09
Register a general javascript file using the EXAMPLE_JS_URL constant defined in the main plugin file
<?php
/**
* Enqueue a JavaScript file using a constant
* called EXAMPLE_JS_URL to get the plugin's js directory url.
*
* @author FAT Media <http://youneedfat.com>
* @copyright Copyright (c) 2013, FAT Media, LLC
* @license GPL-2.0+
*/
@robneu
robneu / example-required.php
Last active December 15, 2015 15:29
A proxy loader file to load an example plugin inside the mu-plugins directory
<?php
/**
* Plugin Name: Example MU Plugin
* Plugin URI: http://example.com
* Description: Site-specific plugin for example.com
* Version: 1.0.0
* Author: FAT Media
* Author URI: http://youneedfat.com
*/