Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Uses a query string (color) to apply a body class.
*
* @param array $classes
* @return array
*/
function ja_dynamic_body_class( $classes ){
if ( empty( $_GET['color'] )
@wpexplorer
wpexplorer / gist:8086713
Last active January 1, 2016 03:39
Add a shopping cart icon to WooCommerce products menu item in the WP 3.8 dashboard
// Remove WooCommerce menu.css on WP 3.8+
add_action( 'admin_print_styles', 'wpex_remove_woocommerce_admin_menu_styles' );
if ( ! function_exists('wpex_remove_woocommerce_admin_menu_styles') ) {
function wpex_remove_woocommerce_admin_menu_styles() {
global $wp_version;
if ( $wp_version >= 3.8 ) {
wp_dequeue_style( 'woocommerce_admin_menu_styles' );
}
}
}
@robneu
robneu / remove-simple-social-icons-style.php
Created October 23, 2013 10:31
Disable the output of styles in the Simple Social Icons plugin from StudioPress.
<?php
add_action( 'after_setup_theme', 'prefix_disable_simple_social_icons_styles' );
/**
* Remove Simple Social Icons styles.
*
* Simple Social Icons loads styles with a bunch of !important declarataions.
* This will disable the style output and allow you to style your icons in your
* theme more easily.
*
* @author FAT Media, LLC
@jaredatch
jaredatch / .gitignore
Created September 12, 2012 23:02
Base .gitignore
.svn*
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
.gitignore
Icon?
ehthumbs.db
Thumbs.db
@billerickson
billerickson / functions.js
Created August 3, 2012 20:23
Gravity Forms labels used as placeholders
jQuery(document).ready(function($){
// gravity forms custom placeholders
$('#inner li.gfield .gfield_label').click(function(){
$(this).next('.ginput_container').find('input[type="text"], textarea').focus();
})
$('#inner .ginput_container input[type="text"], #inner .ginput_container textarea')
.focus(function(){
$(this).closest('.ginput_container').prev('.gfield_label').hide();
@GaryJones
GaryJones / functions.php
Last active September 30, 2015 01:17
Split Sidebar in Genesis - http://gamajo.com/split-sidebar-genesis
<?php
// Don't include the <?php above
add_action( 'after_setup_theme', 'prefix_register_split_sidebars', 5 );
/**
* Register the two widget areas that make up our visually separated sidebar.
*
* @author Gary Jones
* @link http://gamajo.com/split-sidebar-genesis
@BrianBourn
BrianBourn / functions.php
Last active August 29, 2015 13:58
WordPress 3.9 filter to remove the blog and archive page templates from Genesis, and function to remove the Genesis theme settings blog metabox
<?php //Do not include opening php tag
add_filter( 'theme_page_templates', 'bourncreative_remove_page_templates' );
/**
* Remove Genesis blog and archive templates from page templates dropdown.
*
* @author Brian Bourn
* @link http://www.bourncreative.com/remove-genesis-blog-archive-page-templates/
*
* @param array $templates List of templates.
@srikat
srikat / functions.php
Created February 5, 2014 14:05
Adding 'Last updated on: date' to post info in Genesis
//* Add last updated date to the post info in entry header (requires HTML5 theme support)
add_filter( 'genesis_post_info', 'sk_post_info_filter' );
function sk_post_info_filter($post_info) {
if (get_the_modified_time() != get_the_time()) {
$post_info = $post_info . '<br/>Last updated on: ' . the_modified_date('F j, Y', '', '', false);
}
return $post_info;
}