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

Coding Header and Footer Verticle Menu Despite PHP

Hi I've got the following html menu

<a href="http://ww.trueternalbeauty.com">Home </a>| <a href="file:///Macintosh HD/Users/iabraham/Desktop/">About</a> | <a href="file:///Macintosh HD/Users/iabraham/Desktop/"> Blog</a> | <a href="file:///Macintosh HD/Users/iabraham/Desktop/"> F.A.Q</a> | <a href="file:///Macintosh HD/Users/iabraham/Desktop/"> Disclaimer</a>

and in my header.php file I added the following code:

        <?php

           $args = array(
            'menu' => 'main-menu',
            'echo' => 'false'
           );


            echo strip_tags(wp_nav_menu( $args),'<a>');

        ?>

as instructed in the video, however upon refresh my menu is still vertical instead of horizontal...someone please help!

Konstantinos Kadoglou
Konstantinos Kadoglou
6,057 Points

Can you please post the video link...

2 Answers

Nevermind I figured it out:

There is a correction needed for the code, posted in the video entitled: Coding the header and footer templates:

it should read <?php

       $args = array(
        'menu' => 'main-menu',
        'echo' => false
       );


        echo strip_tags(wp_nav_menu( $args),'<a>');

    ?>

instead of what I have above in my initial post. This correction will allow your menu to display horizontally instead of vertically.

Brian Eder
Brian Eder
1,008 Points

I'm trying to find the solution to the same problem, but it's unclear what you are saying above? I ended up copying the sample files over what I had created from the tutorial, but still having the same problem. Hoping someone can shed some light on this...

                    <?php

                        $args = array(
                            'menu' => 'main-menu',
                            'echo' => false
                        );


                        echo strip_tags(wp_nav_menu( $args ), '<a>');

                    ?>