NavWalker

master
Seph 2024-05-01 20:29:07 +02:00
parent 3befe56011
commit 7f98344e3d
4 changed files with 12 additions and 11 deletions

View File

@ -1,12 +1,12 @@
/*!
Theme Name: WowPress
Theme URI: https://underscoretw.com/
Author: underscoretw.com
Author URI: https://underscoretw.com/
Description: A custom theme based on _tw
Version: 0.1.0
Theme URI: https://nebelkrieger.de
Author: Yorndar
Author URI: https://nebelkrieger.de
Description: The next gen NK-Theme
Version: 0.1.1
Tested up to: 6.2
Requires PHP: 7.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: wowpress

View File

@ -295,7 +295,7 @@ require get_template_directory() . '/inc/template-tags.php';
*/
require get_template_directory() . '/inc/template-functions.php';
require get_template_directory() . '/inc/config-functions.php';
require get_template_directory() . '/plugins/wowpress-navwalker.php';
/**
* Hide Admin Bar

View File

@ -9,6 +9,7 @@
*/
use WoWPress\Frontend\Icon;
use WoWPress\Frontend\NavWalker;
?>
@ -68,7 +69,7 @@ use WoWPress\Frontend\Icon;
'container' => false,
'menu_id' => 'primary-menu',
'items_wrap' => '%3$s',
'walker' => new WoWPressNavWalker(),
'walker' => new NavWalker(),
)
);

View File

@ -1,14 +1,14 @@
<?php
namespace WoWPress\Frontend;
use WoWPress\Frontend\Icon;
class WoWPressNavWalker extends \Walker_Nav_Menu
class NavWalker extends \Walker_Nav_Menu
{
function start_lvl(&$output, $depth=0, $args=null) {
$output .= '
<div x-cloak x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="block xl:absolute right-0 w-full mt-2 origin-top-right rounded-md shadow-lg xl:w-48">
<div x-cloak class="px-2 py-2 bg-glass shadow dark-mode:bg-gray-800 w-full flex flex-col gap-2">
<div x-cloak class="px-2 py-2 shadow w-full flex flex-col gap-2" style="background-color:var(--color-deepblue)">
';
}
function end_lvl(&$output, $depth= 0, $args=null) {