Skip to content

Instantly share code, notes, and snippets.

@robneu
robneu / gist:5305057
Last active December 15, 2015 18:39
<?php
function example_image_widget_output( $output, $args, $instance, $id_base ) {
$link_open = '';
$link_close = '';
if ( ! empty ( $instance['link'] ) ) {
$target = ( empty( $instance['new_window'] ) ) ? '' : ' target="_blank"';
$link_open = '<a href="' . esc_url( $instance['link'] ) . '"' . $target . '>';
$link_close = '</a>';
}
@robneu
robneu / remove.php
Created April 5, 2013 08:45
Removing stuff
<?php
/**
* Remove Defualt Functions
*
* This file removes default functions from WordPres
* and the Genesis Framework
*
* @package FF_Framework
* @author Funeral Forward <[email protected]>
* @copyright Copyright (c) 2013, Funeral Forward
@robneu
robneu / edd-settings.php
Last active December 16, 2015 20:19
Modify the EDD settings page for non-super admin users.
<?php
/**
* EDD Super Admin Settings
*
* Modifies the EDD settings page for non-super admin users.
*
* @package EDSU_Admin
* @author FAT Media <[email protected]>
* @copyright Copyright (c) 2012, FAT Media
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
@robneu
robneu / archive-testimonials.php
Last active August 18, 2016 08:34
Testimonials by Woo - Archive Template for Genesis
<?php
/**
* The custom testimonials post type archive template
*
* @since 1.0.0
*
* @author FAT Media <[email protected]>
* @package Genesis
*
* @copyright Copyright (c) 2012, FAT Media
@robneu
robneu / switch-genesis-sidebars.php
Last active December 17, 2015 06:19
Switch Genesis Sidebars on All Dual Sidebar Layouts.
<?php
add_action( 'genesis_after_header', 'fatme_change_sidebar_order' );
/**
* Swap Primary and Secondary Sidebars on layouts with two sidebars
*
* @author Robert Neu
* @author Bill Erickson
* @link http://youneedfat.com/switch-genesis-sidebars/
*/
function fatme_change_sidebar_order() {
jQuery(document).ready(function($) {
$.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;
@robneu
robneu / wordpress-font-awesome-cdn.php
Last active November 29, 2022 10:47
Add Font Awesome to WordPress using a CDN
<?php
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' );
/**
* Register and load font awesome CSS files using a CDN.
*
* @link http://www.bootstrapcdn.com/#fontawesome
* @author FAT Media
*/
function prefix_enqueue_awesome() {
wp_enqueue_style( 'prefix-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3' );
@robneu
robneu / wordpress-font-awesome-ie7-cdn.php
Last active December 17, 2015 21:29
Add Font Awesome With IE7 Support to WordPress using a CDN
<?php
/**
* Registers and loads font awesome
* CSS files using a CDN.
*
* @link http://www.bootstrapcdn.com/#tab_fontawesome
* @author FAT Media
*/
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' );
/**
@robneu
robneu / genesis-cache-busting.php
Last active December 17, 2015 23:08
Make cache busting easier in Genesis by enqueueing a genesis child theme stylesheet with the child theme version appended.
<?php
// Remove the default Genesis child theme CSS
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
add_action( 'wp_enqueue_scripts', 'prefix_load_stylesheet' );
/**
* Get the current child theme version
* and use it to bust the cache by appending
* it to the CSS output.
*
* @author FAT Media
@robneu
robneu / genesis-blog-sidebar.php
Last active December 18, 2015 02:28
Set a different sidebar for all blog posts and archives on the Genesis Framework
<?php
/**
* Swap default sidebar for the blog sidebar
* on blog posts and archives.
*
* @author FAT Media
* @link http://youneedfat.com
*/
add_action( 'genesis_after_header', 'mytheme_change_blog_sidebar' );
function mytheme_change_blog_sidebar() {