This tutorial shows you how to add an image to the left of the primary nav menu in any child theme by StudioPress.
The method should work on other child themes however may need some tweaking of the CSS values.
You’ll find 2 methods in this post:
- The 1st adds an unlinked image before the menu and includes the full image link in the code. Tested on the Enterprise Pro theme
- The 2nd adds a linked image before the menu and pulls the image from your child themes images folder. Tested on the Agency Pro theme.
The PHP code and CSS for both methods are different.
Here’s the code:
Hi Brad,
I would like to add a logo left side of nav-primary area on the Genesis sample theme. I have try to use your above code but didn’t work. Do you have any other code that I can use?
Thank you,
Lobsang
Dear Lobsang. Works when i re-test the code. Maybe you have the minification problem with your CSS again or you forgot to swap out the link to your logo in the PHP code. See the video which shows how to install the code
https://youtu.be/PHOw1yzqEl4
If you’re still having issues, send me FTP access and i’ll install the code for you!
Thank you Brad!
First tried your sound option “linked image” that didn’t work some reason but the first option works great. Thank you for your help!
Lobsang
Tested both and they both work however you must swap out the path to the image in the PHP code. Maybe you missed that?
I’m using news pro and want to get the logo in the secondary menu that displays at the top.
Would the code then be: if ( ‘secondary’ != $args->theme_location ) ?
Yes, and then add/tweak the CSS based on the size of your logo.
Hi Brad,
I decided to stick to the primary using this code:
However, the logo does not appear and I don’t see any output in the HTML either, could you possibly help? Site is: https://sapigeon.co.za/
Could it be because WordPress is installed in a subfolder and not directly in public_html?
Assumes the path to the image is your child themes images folder. You can send me access details and i’ll fix if you can’t.
Awesome! I’ll message you on facebook.