Skip to content

Instantly share code, notes, and snippets.

View ChrisCree's full-sized avatar

Chris Cree ChrisCree

View GitHub Profile
@ChrisCree
ChrisCree / genesis-20-columns.css
Last active December 20, 2015 21:19
Genesis 2.0 Column Classes including 5 columns. The Genesis 2.0 stylesheet includes CSS for column classes of 2, 3, 4 and 6 columns. But it leaves out 5 columns. Here's the 2.0 column classes with the 5 column styles added back in.
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.four-fifths,
.one-fifth,
.one-fourth,
.one-half,
@ChrisCree
ChrisCree / clear_form_fields.js
Last active May 4, 2017 03:31
Customizing the Genesis HTML5 Comment areas to put labels inside entry fields and have them automatically clear when curser selects the fields.
jQuery(document).ready(function() {
jQuery.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;
}
@ChrisCree
ChrisCree / functions.php
Last active October 19, 2017 20:26
Force IE not to use so-called "compatibility" mode in the Genesis theme framework.
<?php
// Do not copy opening php tag
// Force Stupid IE to NOT use compatibility mode
add_filter( 'wp_headers', 'wsm_keep_ie_modern' );
function wsm_keep_ie_modern( $headers ) {
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) ) {
$headers['X-UA-Compatible'] = 'IE=edge,chrome=1';
}
return $headers;
@ChrisCree
ChrisCree / genesis-HTML5.css
Last active December 31, 2015 16:49
These are the changes to the CSS Genesis made in version 2.0. The XHTML selectors are listed on the left and the new HTML5 selectors are listed on the right.
/* Structural
--------------------------------------------- */
#wrap .site-container
#inner .site-inner
#content-sidebar-wrap .content-sidebar-wrap
#content .content
/* Header
--------------------------------------------- */
#header .site-header
@ChrisCree
ChrisCree / childVersion-functions.php
Created July 23, 2014 16:20
To make your Genesis child theme display its version in the style sheet link instead of the Genesis version add this statement to your child theme's functions.php file.
<?php
// Don't copy opening PHP tag above
// Define child theme version
define( 'CHILD_THEME_VERSION', wp_get_theme()->get( 'Version' ) );
@calliaweb
calliaweb / modify-tinymce-editor-to-remove-h1.php
Last active August 3, 2023 16:00
Modify TinyMCE editor to remove H1
<?php
// Do NOT include the opening php tag above
add_filter('tiny_mce_before_init', 'tiny_mce_remove_unused_formats' );
/*
* Modify TinyMCE editor to remove H1.
*/
function tiny_mce_remove_unused_formats($init) {
// Add block format elements you want to show in dropdown
$init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Address=address;Pre=pre';
@ChrisCree
ChrisCree / gf-setngs_functions.php
Created March 4, 2015 19:34
Filter to enable the setting in Gravity Forms where users can hide the field labels. This is useful in conjunction with the new Gravity Forms placeholder functionality as of version 1.9+
<?php
// DO not copy opening PHP tag above
// Enable Gravity Forms setting to hide form labels
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
@deanoakley
deanoakley / wp-disable-plugin-update.php
Last active March 22, 2024 09:30 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin -
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Add to the core plugin file
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
$plugin_file_name = basename(__DIR__) . '/' . basename(__FILE__);
if ( isset( $value->response[$plugin_file_name] ) ) {
unset( $value->response[$plugin_file_name] );