diff --git a/includes/navwalker.php b/includes/navwalker.php
index 7ff2069..6aec031 100644
--- a/includes/navwalker.php
+++ b/includes/navwalker.php
@@ -7,9 +7,7 @@
function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
{
-
- // #### MENU HOMEGRADE HEADER
- if ($args->theme_location === "secondary" && in_array('menu-item-has-children', $item->classes, true)) {
+ if ($args->theme_location === "secondary" && in_array('menu-item-has-children', $item->classes, true) && $depth === 0) {
$output = '';
return $output;
}
@@ -22,23 +20,36 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
- if ($args->theme_location === "primary" && !in_array('menu-item-has-children', $item->classes, true) && $depth === 1) {
+
+ if (!in_array('menu-item-has-children', $item->classes, true) && $depth === 1) {
$page_icon = get_field('page_icon', $item->object_id) ?? null;
$icon_html = isset($page_icon) && is_array($page_icon) && !empty($page_icon['url']) ? '' : '';
+
$page_subtitle = get_field('page_subtitle', $item->object_id) ?? '';
$subtitle_html = '' . $page_subtitle . '';
+
+ if ($item->url === 'https://carhop.local/a-propos/equipe/') {
+ write_log($item);
+ write_log($subtitle_html);
+ write_log($icon_html);
+ // $icon_html = get_archive_page_icon_html($item->object);
+ // $subtitle_html = get_archive_page_subtitle_html($item->object);
+ }
if ($item->type === 'post_type_archive') {
$icon_html = get_archive_page_icon_html($item->object);
$subtitle_html = get_archive_page_subtitle_html($item->object);
}
+ if ($item->ID === 494) {
+ write_log($item);
+ }
-
- $output = '' . $icon_html . '';
+ $output = '' . $icon_html . '';
return $output;
}
+
return $output;
}
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
@@ -91,7 +102,8 @@ add_filter('nav_menu_submenu_css_class', 'tailpress_nav_menu_add_submenu_class',
function carhop_add_submenu_item_icon($output, $item, $depth, $args)
{
// Only for submenu items (depth >= 1
- if (!isset($args->theme_location) || $args->theme_location !== 'secondary' || $depth < 1 || !function_exists('get_field')) {
+ if (!isset($args->theme_location) || $args->theme_location !== 'secondary' || $depth < 1 || !function_exists('get_field')) {
+
return $output;
}
@@ -102,19 +114,18 @@ function carhop_add_submenu_item_icon($output, $item, $depth, $args)
return $output;
}
-
$icon_html = '';
- $excerpt_html = '';
+ $subtitle_html = '';
// Attachment array with ID (ACF image field)
if (is_array($pageIcon) && isset($pageIcon['url'])) {
$icon_html = '';
}
- if (has_excerpt($item->object_id)) {
- $excerpt_html = '