Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress

Eric Nevitt
Eric Nevitt
4,914 Points

Getting a logo on my custom theme

I'm having trouble getting the logo to show up on my custom theme. The image is in the same folder that the pages are. I don't have it in a images folder, but I will once I get it to work.

I've been doing some research on my problem and there is some PHP code that I'm missing I think.

I think this is the code

<!--LOGO-->
<div id="logo">
<a class="text_logo" href="<?php...?>"><img src="<?php bloginfo('url'); ?>/images/jazzysteez.jpg" alt="" /></a>
<h1><a class="text_logo" href="<?php...?>"><?php bloginfo('name'); ?></h1>
<?php if($option["scl_description"] == "1"){ ?><div class="desc"><?php bloginfo('description')?></div><?php } else { ?><?php } ?>
</div>

9 Answers

<img src="/images/jazzysteez.jpg" alt="Jazzy Steez" />
Eric Nevitt
Eric Nevitt
4,914 Points

So my image would go before the php?

I think it is best to post the header.php.

This is how my logo code looks. It looks different because they have the option to upload their own logo so it calls in the code:

<div  id='header' class='container wrap_logo'>

            <?php do_action('main_header'); ?>

            <div class='container'>

                <?php 

                echo logo(BASE_URL.'images/logo.png', false, 'strong');
Eric Nevitt
Eric Nevitt
4,914 Points

<div id="logo" class="grid_3"><?php do_action('main_header'); ?>

        <div class='container'>

            <?php 

            echo logo(BASE_URL.'images/logo.png', false, 'strong');</div><!--end logo-->

Something like this?

Eric Nevitt
Eric Nevitt
4,914 Points

Tried the code and it gave me a 500 error.

Good job! :)

The code I posted was for my own site. It was coded a little differently.

Eric Nevitt
Eric Nevitt
4,914 Points

I used the basic HTML. What's the advantage of the other code? Other than the user can place their own logo?

Either way is good.

I only did it to make a template where they can upload an image and set it as the logo. Please let me know what you think of the colors I used in a navigation bar I am working on:

https://teamtreehouse.com/forum/feedback-on-the-colors-in-my-navigation-bar