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

Kelley Kent
Kelley Kent
33,450 Points

Need help with header on "Coding the Header and Footer Templates" lesson

Hi! I'm going through the lessons on Wordpress-How To Build a WordPress Theme-Converting Static HTML into WordPress Templates-Coding the Header and Footer.

I'm following along great but for some reason my navigation/menu bar doesn't appear. If I get rid of the <nav></nav> tags around it, I see my list but putting in the code like the lesson shows, results in a height of 1px and nothing appears. Here is the code I did: <nav>
<?php $args = array( 'menu' => 'main-menu', 'echo' => false ); echo strip_tags(wp_nav_menu( $args ), '<a>'); ?> </nav> When I get rid of the <nav> tag as I said, I see the list show up. What is going on??

3 Answers

Kelley Kent
Kelley Kent
33,450 Points

For some reason this got rid of me saying NAV tags...I did this before and after my code and when I used the "nav" tag, it didn't show up

Kelley Kent
Kelley Kent
33,450 Points

Never-mind, I figured it out :)

Hi Kelley,

Could you please explain what you did here - I am having the same issue, and I can't work out where I am going wrong.

Sheila McManus
Sheila McManus
13,150 Points

I'm having the same problem. Would love to know how you solved it.

Sheila McManus
Sheila McManus
13,150 Points

I fixed my problem (main menu not showing) by adding 'em' to the font-size in the nav a css:

nav a { font-family: 'GoudyRegular'; display: block; -webkit-box-flex:1; text-align:center; font-size: 1.25em; color: #666; width: 240px; }

Thanks you very much! I just spent two hours trying to figure it out...