diff --git a/includes/nawalker_fction.php b/includes/nawalker_fction.php index 3e152d9..1882ea1 100644 --- a/includes/nawalker_fction.php +++ b/includes/nawalker_fction.php @@ -9,12 +9,10 @@ function carhop_wrap_parent_menu_item_buttons($output, $item, $depth, $args) if ($args->theme_location === "primary") { $page_icon = get_field('page_icon', $item->object_id); - - if (isset($page_icon)) { $icon = ''; - $link = $output; - $output = $icon . $link; + // Insérer l'icône à l'intérieur du lien (seulement la première occurrence) + $output = preg_replace('/>/', '>' . $icon, $output, 1); } }