Compare commits
3 Commits
fff24795cd
...
ec0ed00c9e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec0ed00c9e | ||
|
|
e69f9c8f04 | ||
|
|
759cc69b99 |
|
|
@ -8,16 +8,17 @@ require_once(__DIR__ . '/includes/logos.php');
|
||||||
require_once(__DIR__ . '/includes/collective-access-api.php');
|
require_once(__DIR__ . '/includes/collective-access-api.php');
|
||||||
require_once(__DIR__ . '/includes/utilities.php');
|
require_once(__DIR__ . '/includes/utilities.php');
|
||||||
require_once(__DIR__ . '/includes/nawalker_fction.php');
|
require_once(__DIR__ . '/includes/nawalker_fction.php');
|
||||||
|
require_once(__DIR__ . '/includes/navwalker.php');
|
||||||
require_once(__DIR__ . '/includes/options-social-networks.php');
|
require_once(__DIR__ . '/includes/options-social-networks.php');
|
||||||
require_once(__DIR__ . '/includes/options-presse.php');
|
require_once(__DIR__ . '/includes/options-presse.php');
|
||||||
require_once(__DIR__ . '/includes/api.php');
|
require_once(__DIR__ . '/includes/api.php');
|
||||||
require_once(__DIR__ . '/includes/forms.php');
|
require_once(__DIR__ . '/includes/forms.php');
|
||||||
require_once(__DIR__ . '/includes/rapport-activites.php');
|
require_once(__DIR__ . '/includes/rapport-activites.php');
|
||||||
require_once(__DIR__ . '/includes/equipe.php');
|
require_once(__DIR__ . '/includes/equipe.php');
|
||||||
require_once(__DIR__ . '/includes/navwalker.php');
|
|
||||||
require_once(__DIR__ . '/includes/post-type-analyses-etudes.php');
|
require_once(__DIR__ . '/includes/post-type-analyses-etudes.php');
|
||||||
require_once(__DIR__ . '/includes/posts-save.php');
|
require_once(__DIR__ . '/includes/posts-save.php');
|
||||||
require_once(__DIR__ . '/includes/auteurs.php');
|
require_once(__DIR__ . '/includes/auteurs.php');
|
||||||
|
|
||||||
// require_once(__DIR__ . '/includes/widget.php');
|
// require_once(__DIR__ . '/includes/widget.php');
|
||||||
// require_once( __DIR__ . '/includes/taxonomy.php');
|
// require_once( __DIR__ . '/includes/taxonomy.php');
|
||||||
// require_once( __DIR__ . '/includes/errorlog.php');
|
// require_once( __DIR__ . '/includes/errorlog.php');
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,19 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($args->theme_location === "primary") {
|
||||||
|
$page_icon = get_field('page_icon', $item->object_id) ?? null;
|
||||||
|
|
||||||
|
if (isset($page_icon) && is_array($page_icon) && !empty($page_icon['url'])) {
|
||||||
|
$icon = '<img class="page_icon" src="' . $page_icon['url'] . '" alt=""/>';
|
||||||
|
$output = preg_replace('/>/', '>' . $icon, $output, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($args->theme_location === "footer" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||||
|
$output = $item->title;
|
||||||
|
}
|
||||||
|
|
||||||
if (!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;
|
$page_icon = get_field('page_icon', $item->object_id) ?? null;
|
||||||
|
|
@ -118,3 +129,18 @@ function carhop_add_submenu_item_icon($output, $item, $depth, $args)
|
||||||
return '<a class="menu-item__content" href="' . $item->url . '">' . $icon_html . '<div class="menu-item__content-inner"><p class="menu-item__title">' . $item->title . '</p>' . $subtitle_html . '</div></a>';
|
return '<a class="menu-item__content" href="' . $item->url . '">' . $icon_html . '<div class="menu-item__content-inner"><p class="menu-item__title">' . $item->title . '</p>' . $subtitle_html . '</div></a>';
|
||||||
}
|
}
|
||||||
add_filter('walker_nav_menu_start_el', 'carhop_add_submenu_item_icon', 15, 4);
|
add_filter('walker_nav_menu_start_el', 'carhop_add_submenu_item_icon', 15, 4);
|
||||||
|
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------
|
||||||
|
Add class to menu items with page icon
|
||||||
|
-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
function carhop_add_page_icon_class($classes, $item)
|
||||||
|
{
|
||||||
|
$page_icon = get_field('page_icon', $item->object_id);
|
||||||
|
if (isset($page_icon) || $item->type === 'post_type_archive') {
|
||||||
|
$classes[] = 'has-page-icon';
|
||||||
|
}
|
||||||
|
return $classes;
|
||||||
|
}
|
||||||
|
add_filter('nav_menu_css_class', 'carhop_add_page_icon_class', 10, 2);
|
||||||
|
|
|
||||||
|
|
@ -21,21 +21,4 @@ function carhop_wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
add_filter('walker_nav_menu_start_el', 'carhop_wrap_parent_menu_item_buttons', 10, 4);
|
// add_filter('walker_nav_menu_start_el', 'carhop_wrap_parent_menu_item_buttons', 10, 4);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------
|
|
||||||
Add class to menu items with page icon
|
|
||||||
-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
function carhop_add_page_icon_class($classes, $item)
|
|
||||||
{
|
|
||||||
$page_icon = get_field('page_icon', $item->object_id);
|
|
||||||
if (isset($page_icon) || $item->type === 'post_type_archive') {
|
|
||||||
$classes[] = 'has-page-icon';
|
|
||||||
}
|
|
||||||
return $classes;
|
|
||||||
}
|
|
||||||
add_filter('nav_menu_css_class', 'carhop_add_page_icon_class', 10, 2);
|
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,22 @@ body:has(.primary-menu-container .sub-menu-open) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu-item-object-custom.item-catalogue {
|
||||||
|
a {
|
||||||
|
@apply flex flex-col items-center justify-center gap-4;
|
||||||
|
}
|
||||||
|
a:before {
|
||||||
|
@apply content-[''] block bg-contain bg-center bg-no-repeat;
|
||||||
|
@apply w-7 h-7 object-contain object-center;
|
||||||
|
background-image: url('../resources/img/icons/icon-catalogue.svg');
|
||||||
|
transition: transform 0.3s ease-out;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
a:before {
|
||||||
|
transform: scale(1.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
li#menu-item-1836 {
|
li#menu-item-1836 {
|
||||||
@apply border border-white relative;
|
@apply border border-white relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
1
resources/img/icons/icon-catalogue.svg
Normal file
1
resources/img/icons/icon-catalogue.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg width="20.236" xmlns="http://www.w3.org/2000/svg" height="32.147" id="screenshot-a2556a6c-3214-8099-8006-165931dde03e" viewBox="-0.118 -0.073 20.236 32.147" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1"><g id="shape-a2556a6c-3214-8099-8006-165931dde03e"><g class="fills" id="fills-a2556a6c-3214-8099-8006-165931dde03e"><rect width="19.99999999999966" height="31.99999999999534" class="cls-1" x="0" transform="matrix(0.999973, 0.007385, -0.007385, 0.999973, 0.118427, -0.073410)" style="fill: rgb(255, 255, 255); fill-opacity: 1;" ry="0" rx="0" y="0"/></g><g class="strokes" id="strokes-64d18485-4f45-809a-8006-1cef467337e3-a2556a6c-3214-8099-8006-165931dde03e"><g class="inner-stroke-shape" transform="matrix(0.999973, 0.007385, -0.007385, 0.999973, 0.118427, -0.073410)"><defs><clipPath id="inner-stroke-render-1-a2556a6c-3214-8099-8006-165931dde03e-0"><use href="#stroke-shape-render-1-a2556a6c-3214-8099-8006-165931dde03e-0"/></clipPath><rect rx="0" ry="0" x="0" y="0" width="19.99999999999966" height="31.99999999999534" id="stroke-shape-render-1-a2556a6c-3214-8099-8006-165931dde03e-0" style="fill: none; stroke-width: 4; stroke: rgb(255, 255, 255); stroke-opacity: 1;"/></defs><use href="#stroke-shape-render-1-a2556a6c-3214-8099-8006-165931dde03e-0" clip-path="url('#inner-stroke-render-1-a2556a6c-3214-8099-8006-165931dde03e-0')"/></g></g></g></svg>
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue
Block a user