Skip to content

Instantly share code, notes, and snippets.

@bradpotter
bradpotter / functions.php
Last active July 18, 2017 08:26
How to Add “Top” and “Footer” Menus to Genesis
// Register and Hook Top Navigation Menu
add_action('genesis_before_header', 'sample_before_header_menu', 10);
function sample_before_header_menu() {
register_nav_menu( 'top', 'Top Navigation Menu' );
genesis_nav_menu( array(
'theme_location' => 'top',
'menu_class' => 'menu genesis-nav-menu menu-top',
) );
@bradpotter
bradpotter / functions.php
Last active April 18, 2017 07:18
Create a header wrapper and relocate titles (Broken down into various functions, several of which could be combined)
//* Create Header Wrapper Open
add_action('genesis_after_header', 'entry_header_wrapper_open', 10 );
function entry_header_wrapper_open() {
if ( ! is_home () ) {
echo '<div class="entry-header-wrapper"><div class="wrap">';
}
}
@bradpotter
bradpotter / responsive-menu-header-pri-sec.js
Last active October 31, 2017 22:20
Combine Header, Primary and Secondary Menu into one Responsive Menu
/* Make sure your Menus are named Header Navigation, Primary Navigation and Secondary Navigation in Appearance > Menus */
(function( window, $, undefined ) {
'use strict';
$('.nav-primary').before('<button class="menu-toggle" role="button" aria-pressed="false"></button>'); // Add toggles to menus
$('nav .sub-menu').before('<button class="sub-menu-toggle" role="button" aria-pressed="false"></button>'); // Add toggles to sub menus
// Show/hide the navigation
$('.menu-toggle, .sub-menu-toggle').click(function() {
@bradpotter
bradpotter / responsive-menu.js
Last active January 4, 2016 15:28
Combine Primary and Secondary Menu into one Responsive Menu
/* Make sure your Menus are named Primary Navigation and Secondary Navigation in Appearance > Menus */
(function( window, $, undefined ) {
'use strict';
$('.nav-primary').before('<button class="menu-toggle" role="button" aria-pressed="false"></button>'); // Add toggles to menus
$('nav .sub-menu').before('<button class="sub-menu-toggle" role="button" aria-pressed="false"></button>'); // Add toggles to sub menus
// Show/hide the navigation
$('.menu-toggle, .sub-menu-toggle').click(function() {
@pdewouters
pdewouters / gist:5391496
Created April 15, 2013 21:42
use an image for the logo in genesis child theme
/**
* Use an img tag for the logo
* @param $title
* @param $inside
* @param $wrap
*
* @return string
*/
function ssm_modify_site_title_html( $title, $inside, $wrap ) {
@mattonomics
mattonomics / gist:3912424
Created October 18, 2012 15:04
Add CSS to Thesis via the CSS filter
<?php
// add css using the thesis_css filter
class your_skin_class extends thesis_skin {
function construct() {
add_filter('thesis_css', array($this, 'add_css'));
}
@wpsmith
wpsmith / child_nav_menu_args.php
Created September 7, 2012 01:56
Modifies the Navigation Menu based on current user capabilities
add_filter( 'wp_nav_menu_args', 'child_nav_menu_args' );
/**
* Modifies the Navigation Menu based on current user capabilities
*
* @uses gbootstrap_nav_args() Sets Genesis Bootstrap Navigation Args for wp_nav_menu().
* @param array $args Arguments for wp_nav_menu()
* @return array $args Modified Arguments for wp_nav_menu()
* @since 1.0.0
*/
function child_nav_menu_args( $args ) {
<?php
// Nav Menu Dropdown Class
include_once( CHILD_DIR . '/lib/classes/nav-menu-dropdown.php' );
/**
* Mobile Menu
*
*/
function be_mobile_menu() {