How to separate sub-menu output and keep associated with parent


I am creating a menu like this I have the html,css, and jquery ready. Now, I am trying to:

Create the menu items with it’s sub-menu items via wp-admin -> appearance -> menus ( which I have done )

output the menu item with it’s corresponding sub-menu items separately and dynamically.

        <?php if ( get_field('landing_hero_image') ): ?>
                <div class="menu" style="background-image: url(<?php the_field('landing_hero_image'); ?>);">
                    <a class="click-me">
                        main menu item
                <div class="hidden-content">
                    sub menu item associated with the main item
                <div class="banner" style="background-image: url(<?php the_field('landing_hero_image'); ?>);">
            <?php endif; ?>

So to summarize, how do I separate the output ( html ) menu items and their children?

Many thanks in advance.

, , rlm 7 years 2016-04-15T14:16:07-05:00 0 Answers 68 views 0

Leave an answer