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 trialDungaamaa Tudevdorj
8,815 PointsCustomized menu
Hello I am following Wordpress custom Theme class, and also working on my own blog. My prototype menu has class and span which styles each menu item background color. For example:
<a class=*"blue"* href="#"><span>About</span></a>
<a class=*"orange"* href="#"><span>Portfolio</span></a>
</nav>```
So far I get to show my menu, but how I add class on each <a> tag, so background will be different colors?
Also How to add *background image on whole web page*? I tried inline style on body tag in header.php, but it did not work.
Thank you
5 Answers
Richard Feinburg
2,970 PointsIn your CSS stylesheet. You can change the body information with. I don't know what you mean by the background color of the menu. I see you did not provide an unorder list <ul>, <li>. Remember you add that stuff to the menu to get it working.
body { background: url(); }
Dungaamaa Tudevdorj
8,815 Points1. Its all about wordpress custom theme styling. My images some reason does not connect. I am using
<img src="<? php bloginfo('template_directory'); ?>/images/logo.png" alt="">
Where my images are in >themes>ssblog>images>logo.png.
2. Also that body background-image does not show when i add inline style inside my header.php
3. Another image issue i have is custom post type
<div class="portfolio_image"> <img src="<? php the_field ( 'portfolio_image' ); ?>" ></div>
Im doing something wrong about these images. Any of my image does not show on my WP blog
Help!
Zac Gordon
Treehouse Guest TeacherWhat link does it give you in your source code for what you wrote in #1 and #3?
Dungaamaa Tudevdorj
8,815 Points3 <img src="70, , zen_art, Zen Art, , image/png, http://localhost/web2blog/wp-content/uploads/2013/12/ZEN_art.png">
this one i upload to admin and used the_field()
1 <img src="ssblog/images/logo.png" alt="SunniiStudio">
on this one i used 'template_directory'
Zac Gordon
Treehouse Guest TeacherBack in the settings for the custom field, make sure that you have it set to only give you the URL for the image and not the full image object. That should help.