diff --git a/theme/assets/css/main.css b/theme/assets/css/main.css index 5dad7ab..999104a 100644 --- a/theme/assets/css/main.css +++ b/theme/assets/css/main.css @@ -364,6 +364,13 @@ p:last-child { margin-bottom: 0; } .nav-menu a:hover::after, .nav-menu .current-menu-item > a::after { width: 100%; } +/* Contact button in nav */ +.nav-contact a.btn { + padding: .6rem 1.4rem; + font-size: .85rem; +} +.nav-contact a.btn::after { display: none; } /* Remove underline animation from button */ + /* ── Dropdown sub-menu ─────────────────────────────────────── */ .nav-menu > li { position: relative; diff --git a/theme/blocks/index.php b/theme/blocks/index.php index 44ba943..216a297 100644 --- a/theme/blocks/index.php +++ b/theme/blocks/index.php @@ -705,7 +705,7 @@ function oribi_fallback_menu() { echo '
  • Pricing
  • '; echo '
  • Partners
  • '; echo '
  • About
  • '; - echo '
  • Contact
  • '; + echo ''; echo ''; } diff --git a/theme/inc/setup.php b/theme/inc/setup.php index 039d6a7..8e57d35 100644 --- a/theme/inc/setup.php +++ b/theme/inc/setup.php @@ -61,3 +61,42 @@ add_action( 'init', function () { add_action( 'after_setup_theme', function () { remove_theme_support( 'core-block-patterns' ); } ); + +/* ── Nav menu filters ──────────────────────────────────────── */ +/** + * Add button class to Contact menu item for styling as an orange button. + */ +add_filter( 'nav_menu_link_attributes', function ( $atts, $item, $args ) { + // Only apply to the primary menu + if ( $args->theme_location !== 'primary' ) { + return $atts; + } + + // Check if this is the Contact menu item (by URL or title) + $contact_url = home_url( '/contact' ); + if ( strpos( $item->url, 'contact' ) !== false || $item->title === 'Contact' ) { + // Add button classes + $atts['class'] = isset( $atts['class'] ) ? $atts['class'] . ' btn btn-primary' : 'btn btn-primary'; + } + + return $atts; +}, 10, 3 ); + +/** + * Add nav-contact class to Contact menu item's list element. + */ +add_filter( 'nav_menu_li_attributes', function ( $atts, $item, $args, $depth ) { + // Only apply to the primary menu + if ( $args->theme_location !== 'primary' ) { + return $atts; + } + + // Check if this is the Contact menu item (by URL or title) + if ( strpos( $item->url, 'contact' ) !== false || $item->title === 'Contact' ) { + // Add nav-contact class + $atts['class'] = isset( $atts['class'] ) ? $atts['class'] . ' nav-contact' : 'nav-contact'; + } + + return $atts; +}, 10, 4 ); +