Amy-Mir / loop-templates / subMenu.php
subMenu.php
Raw
<?php
/**
 * Partial template for content in header.php
 *
 * @package UnderStrap
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<div class="header__subMenuHook">
    <div class="header__subMenuWrapper">
        <?php 
                                    
        if(have_rows('sub_menu', 'option')): 
                                    
        while(have_rows('sub_menu','option')): the_row();
                                    
        while(have_rows('sub_menu_items')): the_row();

        $subMenuTitle = get_sub_field('sub_menu_group_title');
                                        
        ?>

        <div class="header__subMenu">
            <h1 class="heading4"><?php echo esc_html($subMenuTitle); ?></h1>
            <ul>
                <?php while(have_rows('sub_menu_group_items')): the_row(); ?>

                <li>
                    <a href='<?php echo esc_attr(get_sub_field('sub_menu_link_url')); ?>'>
                        <?php echo esc_html(get_sub_field('sub_menu_link_text')); ?>
                    </a>
                </li>

                <?php endwhile; ?>
            </ul>
        </div>

        <?php 

        endwhile;
        endwhile;
        endif; 
                                    
        ?>

    </div>
</div>