Skip to content

Instantly share code, notes, and snippets.

View PittsburghChris's full-sized avatar

Chris Field PittsburghChris

View GitHub Profile
@ozzyrod
ozzyrod / responsive-menu-css.css
Last active April 23, 2019 05:54
Creates a mobile responsive menu in a Genesis child theme with support for collapsible sub menus.
/* Responsive Navigation
---------------------------------------------------------------------------------------------------- */
/* Standard Navigation
--------------------------------------------- */
nav {
clear: both;
}
jQuery(document).ready(function($) {
$("body").show();
$( "#accordion" ).accordion({
collapsible: true,
active: false,
header: '> div.my-accordion-section > h3',
heightStyle: 'content'
});
});
genesis_register_sidebar( array(
'id' => 'home-bkgrd-image',
'name' => __( 'Home Background Image', 'minimum' ),
'description' => __( 'Widgets placed here will appear on top of home background image.', 'minimum' ),
) );
//* Add overlay div below home slider
add_action( 'genesis_after_header', 'minimum_home_bkgrd_image_overlay', 9 );
function minimum_home_bkgrd_image_overlay() {
@cdils
cdils / after-entry-widget.php
Last active December 28, 2015 05:18
Drop this in functions.php in any Genesis HTML5-enabled theme to add a widget area after single posts.
<?php // Get rid of this tag
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'after-entry',
'name' => __( 'After Entry', 'theme-prefix' ),
'description' => __( 'This is the after entry section.', 'theme-prefix' ),
) );
//* Hooks after-entry widget area to single posts
@rickrduncan
rickrduncan / genesis-page-titles-html5.php
Last active August 1, 2022 11:16
How to remove page titles from Genesis child themes using XHTML and HTML5 methods.
<?php
//* Do NOT include the opening php tag
//* ALL EXAMPLES ON THIS PAGE USE THE NEW HTML5 METHOD
//* Remove page titles site wide (posts & pages) (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
@studiopress
studiopress / functions.php
Last active May 23, 2017 07:17
Load Google Fonts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Enqueue Lato Google font
add_action( 'wp_enqueue_scripts', 'sp_load_google_fonts' );
function sp_load_google_fonts() {
wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,700', array(), CHILD_THEME_VERSION );
}
@brycejacobson
brycejacobson / genesis_remove_shiv.php
Created August 23, 2013 18:00
Remove html5 shiv from Genesis and add Modernizr instead
<?php
//* Do NOT include opening php tag
//* Remove Genesis hmlt5 shiv and add Modernizr instead
remove_action( 'wp_head', 'genesis_html5_ie_fix' );
add_action( 'wp_head', 'add_mondernizr' );
function add_mondernizr() {
if ( ! genesis_html5() )
return;
@robneu
robneu / style-2.css
Last active December 20, 2015 22:09
Genesis mobile menu styles for Genesis 2.0 and above.
/*
Mobile Menu for Genesis 2.0
Version: 2.0.0
License: GPL-2.0+
License URI: http://www.opensource.org/licenses/gpl-license.php
*/
/* Primary Navigation
--------------------------------------------- */
@wpspeak
wpspeak / functions.php
Created June 9, 2013 00:45
Remove Genesis Framework Layouts
<?php
// Remove Genesis layouts
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'full-width-content' );
@media317
media317 / WP Image Size to Media Selection
Last active December 17, 2015 11:38
Add Image Sizes to Media Selection
//** Add image sizes to Media Selection */
add_filter('image_size_names_choose', 'me_display_image_size_names_muploader', 11, 1);
function me_display_image_size_names_muploader( $sizes ) {
$new_sizes = array();
$added_sizes = get_intermediate_image_sizes();
// $added_sizes is an indexed array, therefore need to convert it
// to associative array, using $value for $key and $value