WowPress-Tailwind/theme/template-parts/layout/header-content.php

77 lines
1.7 KiB
PHP
Raw Normal View History

2024-04-15 16:00:49 +02:00
<?php
/**
* Template part for displaying the header content
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WowPress
*/
2024-04-26 17:47:19 +02:00
use WoWPress\Frontend\Icon;
2024-04-15 16:00:49 +02:00
?>
2024-04-17 22:10:17 +02:00
<header id="masthead" class="bg-glass">
2024-04-15 16:00:49 +02:00
<div>
<?php
if (is_front_page()) :
?>
<h1 class="text-center"><?php bloginfo('name'); ?></h1>
<?php
else :
?>
<p class="text-center"><a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></p>
<?php
endif;
$wowpress_description = get_bloginfo('description', 'display');
if ($wowpress_description || is_customize_preview()) :
?>
<p><?php echo $wowpress_description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?></p>
<?php endif; ?>
</div>
<div x-data="{ open: false }" class="flex flex-col max-w-screen-xl px-4 py-2 mx-auto xl:items-center xl:justify-center xl:flex-row xl:px-8">
<div class="py-2 xl:hidden flex flex-row items-center justify-center" style="--btn-color : white">
<button class="btn btn-outline w-full" @click="open = !open">
Menü
<div x-show="!open">
2024-04-26 17:47:19 +02:00
<?=Icon::get('o-bars-3')?>
2024-04-15 16:00:49 +02:00
</div>
<div x-show="open">
2024-04-26 17:47:19 +02:00
<?=Icon::get('o-x-mark')?>
2024-04-15 16:00:49 +02:00
</div>
</button>
</div>
<nav id="site-navigation" :class="{'flex': open, 'hidden': !open}" class="flex-col flex-grow pb-4 md:pb-0 hidden xl:flex xl:justify-center xl:flex-row gap-2">
<?php
wp_nav_menu(
array(
'theme_location' => 'menu-1',
'container' => false,
'menu_id' => 'primary-menu',
'items_wrap' => '%3$s',
'walker' => new WoWPressNavWalker(),
)
);
?>
</nav><!-- #site-navigation -->
</div>
</header><!-- #masthead -->