This repository has been archived on 2024-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
qdouze2-wordpress-theme/components/mobile-sidebar.php

48 lines
1.6 KiB
PHP
Raw Normal View History

2023-05-02 11:20:14 +02:00
<nav id="mobile-sidebar" class="bg-dark fg-light sidebar menu hidden">
2023-05-03 11:27:05 +02:00
<h1 class="align-center text-light">Menu du site</h1>
2023-05-02 11:20:14 +02:00
<div class="mb-1">
<?php include(TEMPLATEPATH . '/components/searchform.php'); ?>
</div>
<ul>
2023-05-03 11:27:05 +02:00
<h2>Menu principal</h2>
2023-05-02 11:20:14 +02:00
<li>
<a href="<?php echo site_url(); ?>" class="menu-item">
2023-11-20 13:04:09 +01:00
<span><svg class="icon icon-home" alt=""><use xlink:href="#icon-home"></use></svg> Accueil</span>
2023-05-02 11:20:14 +02:00
</a>
</li>
<?php
$listmenu = get_nav_menu_locations();
$menu = wp_get_nav_menu_items($listmenu['top-navbar']);
foreach ($menu as $menuElement) {
echo '<li><a href="' . $menuElement->url . '" class="menu-item">'. $menuElement->title . '</a></li>';
}
?>
</ul>
<ul>
<h2>Liste des catégories</h2>
<?php
$categories = get_categories( array(
'orderby' => 'name',
'order' => 'ASC'
) );
foreach( $categories as $category ) {?>
<li>
<a class="menu-item" href="<?php echo get_category_link($category->term_id) ?>"><?php echo $category->name ?></a>
</li>
<?php }
?>
</ul>
2023-05-03 11:27:05 +02:00
<ul>
<h2>Pages</h2>
<?php
$listmenu = get_nav_menu_locations();
$menu = wp_get_nav_menu_items($listmenu['top-navbar-2']);
foreach ($menu as $menuElement) {
echo '<li><a href="' . $menuElement->url . '" class="menu-item">'. $menuElement->title . '</a></li>';
}
?>
</ul>
2023-05-02 11:20:14 +02:00
</nav>
2023-11-20 13:04:09 +01:00
<button id="mobile-button" class="menu-button"><svg class="icon icon-bars" alt=""><use xlink:href="#icon-bars"></use></svg> <span class="sr-only">Afficher le menu</span></button>