How To Add Your Site Title In Your Nav Menu

This code enables you to add your site title within your nav menu like this :

In this screenshot, the site title displays within the primary nav menu as the first item in the menu which you can easily target using the .site-title-menu class.

The title is only added to the menu if the custom logo has been added & the site title exists otherwise it displays in replace of your custom logo in the default theme position which in this case is the site header of the Genesis Sample child theme.

Customize

When the site title is added or removed from the customize > Site Title field, the customizer preview will update accordingly as seen in the following demo video.

Demo Video

Shows the site title added to the primary nav menu via the customizer when a logo exists.

Tested using the Genesis Sample child theme by StudioPress however will work in any WordPress theme.

Installation Steps

There’s only 1 – 2 steps :

  1. # Copy & paste the PHP code from the functions.php file to the end of your child themes functions file.
  2.  

  3. # Add your site title to the customize > Site Title field and click publish.
  4.  

Download Folder

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.