Last active
October 29, 2016 01:09
-
-
Save srikat/ae339e796e7fe33bb658 to your computer and use it in GitHub Desktop.
How to reposition Primary Navigation conditionally in Genesis. https://sridharkatakam.com/how-to-reposition-primary-navigation-conditionally-in-genesis/
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 | |
// Reposition the primary navigation menu conditionally | |
add_action( 'genesis_before', 'sk_resposition_primary_nav' ); | |
function sk_resposition_primary_nav() { | |
// if we are not on a single Post page or archive page or search results page, abort. | |
if ( ! ( is_singular( 'post' ) || is_archive() || is_search() ) ) { | |
return; | |
} | |
remove_action( 'genesis_after_header', 'genesis_do_nav' ); | |
add_action( 'genesis_before_header', 'genesis_do_nav' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment