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
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.
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.
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.
There’s only 1 – 2 steps :
- # Copy & paste the PHP code from the functions.php file to the end of your child themes functions file.
- # Add your site title to the customize > Site Title field and click publish.