Skip to content

Instantly share code, notes, and snippets.

@generatepress
Last active June 12, 2018 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save generatepress/e41f0e0d083b4c2350ac772eb69479f1 to your computer and use it in GitHub Desktop.
Save generatepress/e41f0e0d083b4c2350ac772eb69479f1 to your computer and use it in GitHub Desktop.
Add site title to the navigation. See https://gist.github.com/generatepress/9f99bbfa532ea4f9eafb6bd238b8cc9a for necessary CSS.
add_action( 'after_setup_theme', 'tu_navigation_as_header' );
function tu_navigation_as_header() {
remove_action( 'generate_header', 'generate_construct_header' );
add_action( 'generate_inside_navigation', 'tu_site_title_navigation' );
}
function tu_site_title_navigation() {
?>
<div class="site-branding">
<p class="main-title" itemprop="headline">
<a href="<?php echo site_url(); ?>" rel="home">
<?php bloginfo( 'name' ); ?>
</a>
</p>
</div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment