Last active
January 26, 2016 20:24
-
-
Save carasmo/ecd734e9f881a11a349c to your computer and use it in GitHub Desktop.
Genesis filter genesis_skip_links_output to add the registerd menu 'foo-menu' to the array. See other gist https://gist.github.com/carasmo/a988e9b4126cdb9f28e6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// don't include this | |
/** ==================================================================================== | |
* add skip links to new nav | |
* filter 'genesis_skip_links_output' to add new | |
* https://gist.github.com/carasmo/a988e9b4126cdb9f28e6 | |
==================================================================================== **/ | |
function foo_nav_skip_links_output( $links ){ | |
$foolink = $links; | |
array_splice( $foolink, 3 ); | |
if ( has_nav_menu( 'foo-menu' ) ) { | |
$foolink['foo-nav'] = __( 'Skip to Foo Nav', 'your-text-domain' ); | |
} | |
return array_merge( $foolink, $links ); | |
} | |
add_filter( 'genesis_skip_links_output', 'foo_nav_skip_links_output' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment