Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Kevin Brown
Kevin Brown
2,312 Points

How do I replace the Bootstrap branding with a logo that I can upload via WordPress admin area?

I'm creating a theme for a client who has a logo that they will need to update via WP admin area. How can I add that functionality into the Bootstrap to WordPress project? Thank you!

Kevin

2 Answers

Sue Dough
Sue Dough
35,800 Points

I found this online. I think this may be what you are looking for.

<div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" rel="home" href="#" title="Mike the Frog"> <img style="max-width:100px; margin-top: -7px;" src="/img/transparent-white-logo.png"> </a> </div>

However I am a bit confused. Why does the client need to change their logo? Does their logo change colors or something? I don't know why something like that would be useful. But if you really need that then look into the wordpress api customizer tutorial http://teamtreehouse.com/library/wordpress-customizer-api . You could make a setting for the client to upload their logo and then set it to where you need in the theme.

Kevin Brown
Kevin Brown
2,312 Points

Because my client wants to reuse the template for different divisions within their corporation.

Thank you for the help!

Kevin

Sue Dough
Sue Dough
35,800 Points

Now that makes sense. Use the wordpress customizer then. Build an option for logo so anyone who uses the theme can easily navigate through it. It may also help to find a free theme that uses bootstrap and has this functionality built in or read some tutorials.

Check out this.

http://kwight.ca/2012/12/02/adding-a-logo-uploader-to-your-wordpress-site-with-the-theme-customizer/

Hope that helps.

Kevin Brown
Kevin Brown
2,312 Points

Thanks, ghost! I'll take a look and see what I can do.

KB