Skip to content

Instantly share code, notes, and snippets.

@theukedge
Created February 21, 2014 20:08
Show Gist options
  • Save theukedge/9142398 to your computer and use it in GitHub Desktop.
Save theukedge/9142398 to your computer and use it in GitHub Desktop.
<?php
$header_menu_query = get_transient( 'header_menu_query' );
if( $header_menu_query === false ) {
if ( has_nav_menu( 'header-menu' ) ) {
$header_menu_query = wp_nav_menu( array(
'menu' => '33',
'depth' => 3,
'container' => 'nav',
'menu_class' => 'nav nav-pills',
'fallback_cb' => 'wp_page_menu',
'walker' => new wp_bootstrap_navwalker(),
'echo' => 0,
) );
}
set_transient( 'header_menu_query', $header_menu_query, 60*60*24 );
}
echo $header_menu_query;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment