Skip to content

Instantly share code, notes, and snippets.

@designbuildtest
Created May 26, 2014 23:22
Show Gist options
  • Save designbuildtest/603577e0047365b4368f to your computer and use it in GitHub Desktop.
Save designbuildtest/603577e0047365b4368f to your computer and use it in GitHub Desktop.
Add a home link to wp_page_menu() by default
<?php
/**
* Add a home link to wp_page_menu() by default
*/
function twentyfourteen_page_menu_args( $args ) {
$show_on_front = get_option('show_on_front');
if ( $show_on_front == 'posts' ) {
$args['show_home'] = true;
}
return $args;
}
add_filter( 'wp_page_menu_args', 'twentyfourteen_page_menu_args' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment