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

Dynamic wordpress menu not showing up when building out theme?

I'm following the Wordpress Theme Development course and for some reason, my footer.php isn't outputting the correct js for the dynamic wordpress menu to show up on top?

Here's what I have in my footer.php:

    <div class="footer-clear"></div>
<footer class="row no-max pad">
  <p>Copyright <?php echo date('Y'); ?></p>
</footer>

<?php wp_footer(); ?>

</body> </html>

Is it something wrong in my js files?

Thanks in advanced!

2 Answers

Andrew Shook
Andrew Shook
31,709 Points

Can you post you functions.php file so we can see how you are enqueuing your scripts?

<?php

add_theme_support ( 'menus' );
add_theme_support ( 'post-thumbnails' );

function register_theme_menus() {

    register_nav_menus(
        array(
            'primary-menu' => _( 'primary-menu' )
            )
        );
}

add_action( 'init', 'register_theme_menus' );

function wpt_theme_styles() {

    wp_enqueue_style( 'foundation_css', get_template_directory_uri() . '/css/foundation.css' );
    // wp_enqueue_style( 'normalize_css', get_template_directory_uri() . '/css/normalize.css' );
    wp_enqueue_style( 'googlefont_css', 'http://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic' );
    wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );

}
add_action( 'wp_enqueue_scripts', 'wpt_theme_styles' );

function wpt_theme_js() {

    wp_enqueue_script( 'modernizr_js', get_template_directory_uri() . '/js/modernizr.js', '', '', false );
    wp_enqueue_script( 'foundation_js', get_template_directory_uri() . '/js/foundation.min.js', array('jquery'), '', true );
    wp_enqueue_script( 'main_js', get_template_directory_uri() . '/js/app.js', array('jquery', 'foundation_js'), '', true );

}

add_action( 'wp_enqueue_scripts', 'wpt_theme_js' );

?>