203 lines
7.7 KiB
PHP
203 lines
7.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Header Navigation template.
|
|
*
|
|
* @package ThemeStarter
|
|
*/
|
|
|
|
require_once(get_theme_file_path('/includes/back-end/helper_functions.php'));
|
|
|
|
?>
|
|
|
|
<header class="mb-28 lg:mb-52 shadow-lg">
|
|
|
|
|
|
<!-- Header -->
|
|
<nav id="header-nav" class="fixed w-full top-0 z-50">
|
|
|
|
|
|
<section class="relative">
|
|
|
|
|
|
|
|
<!-- Top Banner -->
|
|
<div class="bg-stone-800 px-4">
|
|
<div class="max-w-7xl mx-auto py-4">
|
|
<ul class="flex justify-between items-center text-white align-middle content-center">
|
|
<li>
|
|
<a href="tel:(888) 750-5952" class="flex space-x-4">
|
|
<i class="bi-telephone-fill"></i>
|
|
<p class="hidden lg:block">Sales: (888) 750-5952</p>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="https://maps.app.goo.gl/rJijkZjz7sRe99gx5" class="flex space-x-4">
|
|
<i class="bi-geo-alt-fill"></i>
|
|
<p class="hidden lg:block">
|
|
1035 Speers Rd, Oakville, ON, L6L2X5
|
|
</p>
|
|
</a>
|
|
</li>
|
|
<li class="relative">
|
|
<button id="hours-dropdown-toggle" class="flex space-x-4" aria-label="Hours Dropdown">
|
|
<i class="bi-clock-fill"></i>
|
|
<p id="todays-business-hours" class="hidden lg:block">Business Hours</p>
|
|
<i class="bi-caret-down-fill hours-dropdown-icon"></i>
|
|
</button>
|
|
<div id="hours-dropdown-menu" class="hidden top-full right-0 text-black absolute z-50 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5">
|
|
<div class="py-1" role="menu" aria-orientation="vertical" aria-labelledby="hours-dropdown-toggle">
|
|
<div class="px-4 py-2 text-sm" role="none">
|
|
<p class="font-bold text-xl">Hours</p>
|
|
<p class="mt-1">
|
|
<span class="font-bold">Mon - Fri:</span> 10:00 am - 6:00 pm
|
|
</p>
|
|
<p class="mt-1">
|
|
<span class="font-bold">Saturday:</span> 10:00 am - 5:00 pm
|
|
</p>
|
|
<p class="mt-1">
|
|
<span class="font-bold">Sunday:</span> Closed
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Core Nav -->
|
|
<div class="relative px-4 py-2 bg-white backdrop-blur-lg w-full shadow-md">
|
|
|
|
<!-- <div class="absolute top-0 left-0 inset-0 flex w-full">
|
|
<?php /** get_search_form(); */ ?>
|
|
</div> -->
|
|
|
|
<div class="relative z-10 flex justify-between max-w-7xl mx-auto">
|
|
<!-- Header Logo -->
|
|
<a class="relative z-50 flex items-center space-x-4" href="<?php echo get_site_url(); ?>">
|
|
<img class="lg:hidden" width="40px" src="<?php echo get_template_directory_uri(); ?>/icon.png" alt="Rogers Motors Icon Logo" />
|
|
<img class="hidden lg:block" width="350px" src="<?php echo get_template_directory_uri(); ?>/assets/images/logos/rogers-motors-logo.png" alt="Rogers Motors Full Logo" />
|
|
</a>
|
|
|
|
<?php $args = [
|
|
'menu' => "Main",
|
|
'menu_class' => "hidden md:flex space-x-8 flex items-center",
|
|
'container_class' => "flex items-center",
|
|
];
|
|
wp_nav_menu($args); ?>
|
|
|
|
<!-- Header Buttons -->
|
|
<div class="flex space-x-8 items-center">
|
|
<div class="hidden md:block">
|
|
<?php
|
|
get_template_part('template-parts/partials/apply-for-financing-button');
|
|
?>
|
|
</div>
|
|
<!-- <div class="flex relative">
|
|
<button aria-label="Search Toggle" id="toggle-search">
|
|
<i class="bi bi-search"></i>
|
|
</button>
|
|
</div> -->
|
|
<div class="flex relative">
|
|
<button aria-label="Mobile Menu Toggle" id="toggle-nav" class="toggle-menu">
|
|
<i></i> <i></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Dealership Menu -->
|
|
<div class="hidden lg:block bg-stone-200 px-4 shadow-lg">
|
|
<div class="max-w-7xl mx-auto py-4">
|
|
|
|
<?php $args = [
|
|
'menu' => "Main Menu",
|
|
'menu_class' => "w-full flex items-center justify-between",
|
|
'container_class' => "flex justify-between items-center text-xl text-stone-800 align-middle content-center",
|
|
];
|
|
wp_nav_menu($args); ?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
</nav>
|
|
|
|
<!-- Slide Out Section -->
|
|
<section id="slide-out-menu" class="fixed z-50 top-0 bg-gray-200 bg-opacity-80 backdrop-blur-sm w-10/12 sm:w-3/5 lg:w-2/5 xl:w-4/12 2xl:w-3/12 h-full px-2">
|
|
<nav class="h-full space-y-8 overflow-x-hidden overflow-y-scroll no-scrollbar pt-12 pb-28">
|
|
|
|
<!-- Menu Section -->
|
|
<div>
|
|
|
|
<div class="mb-2">
|
|
<a href="<?= esc_url(get_home_url()); ?>" class="flex items-center justify-center space-x-4 ">
|
|
<img class="w-2/3" src="<?php echo get_template_directory_uri(); ?>/assets/images/logos/rogers-motors-logo.png" alt="Rogers Motors Full Logo" />
|
|
</a>
|
|
</div>
|
|
|
|
<div class="mx-auto mb-4 w-11/12 h-1 border-t border-stone-400"></div>
|
|
|
|
<ul role="list" class="space-y-2">
|
|
<!-- Menu Loop -->
|
|
<?php $pages = get_pages_as_array();
|
|
foreach ($pages as $page) {
|
|
$pageID = $page['page']->ID;
|
|
$pageTitle = $page['page']->post_title;
|
|
$pageSlug = $page['page']->post_name;
|
|
$pageBG =
|
|
$page['page']->post_name . '.png';
|
|
$pageBootstrapIcon =
|
|
get_field('bootstrap_icon', $page['page']->ID); ?>
|
|
|
|
<li class="accordion">
|
|
<div class="flex px-2 hover:bg-stone-500 hover:text-white rounded-md justify-between">
|
|
<a href="<?php echo get_site_url() . '/' . $pageSlug; ?>" class="gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold flex items-center align-middle">
|
|
<i class="<?php echo $pageBootstrapIcon ?> text-2xl" aria-hidden="true"></i>
|
|
<p><?php echo $pageTitle ?></p>
|
|
</a>
|
|
|
|
<?php if ($page['subpages']) { ?>
|
|
<button aria-label="Accordion Dropdown Toggle" class="accordion-toggle">
|
|
<i class="fas fa-chevron-down items-center ml-auto rounded-md px-2.5 py-2" aria-hidden="true"></i>
|
|
<i class="fas fa-times items-center ml-auto rounded-md px-3 py-2" aria-hidden="true"></i>
|
|
</button>
|
|
<?php } ?>
|
|
</div>
|
|
<ul class="accordion-content space-y-2">
|
|
<?php foreach ($page['subpages'] as $subpage) {
|
|
$subpageID =
|
|
$subpage->ID;
|
|
$subpageTitle = $subpage->post_title;
|
|
$subpageSlug =
|
|
$subpage->post_name;
|
|
$subpageBG = $subpage->post_name . '.png';
|
|
$subpageBootstrapIcon = get_field('bootstrap_icon', $subpage->ID);
|
|
?>
|
|
<li class="p-2">
|
|
<a href="<?php echo get_site_url() . '/' . $pageSlug . '/' . $subpageSlug ?>" class="flex space-x-2 items-center"><i class="bi-caret-right-fill"></i>
|
|
<p><?php echo $subpageTitle ?></p>
|
|
</a>
|
|
</li>
|
|
|
|
<?php } ?>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- Horizontal Rule -->
|
|
<!-- <div class="horizontal-rule w-4/5 mt-4 mx-auto bg-gray-800"></div> -->
|
|
|
|
<?php } ?>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
get_template_part('template-parts/partials/apply-for-financing-button');
|
|
?>
|
|
</nav>
|
|
</section>
|
|
|
|
</header>
|