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

WordPress Question

What function do I need to use if I want to insert a custom logo in my WordPress template?

3 Answers

Matt Campbell
Matt Campbell
9,767 Points

There is. In your functions.php add the necessary theme support.

https://codex.wordpress.org/Custom_Headers

You call it by using <?php header_image(); ?> as the image source.

Thank You Matthew it worked!

Thanks Leonardo. I was hoping that their would be some sort easy function from WP but thanks for the tip about coding it straight into the template gonna try it.

When developing a theme, someone will want to upload their own logo to their website. Learning how to register theme modifications for editing in the theme editor, or using the custom fields plugin gone over in the WordPress theme development lesson is the way to make your theme fluid for anyone to customize.

If your looking for an easy answer, code it straight into the template.

Place an img folder in you theme directory and put the image in there.

You can use the bloginfo('template_directory') function to echo the path to your theme for your "src" attribute.

Remember that this solution is only for yourself. If you want to make a theme that anyone can use, read up on this. WP_Customize_Control.

This is how I understand it thus far. I am a student myself and there may be a better solution.