• Zur Hauptnavigation springen
  • Skip to main content
  • Zur Hauptsidebar springen
  • Zur Fußzeile springen
Logo

CITROWEB Webdesign

Erste Wahl für Ihren Onlineauftritt

  • Home
  • Leistungen
    • Webdesign, Webentwicklung und Beratung
    • Online-Shops mit WooCommerce
    • Technische Unterstützung für WooCommerce-Shops
    • Suchmaschinenmarketing
      • SEO: Ihr Webauftritt erhält mehr relevante Besucher
      • SEA: Suchmaschinenwerbung für Ihren Webauftritt
    • Webhosting
  • Blog
  • Kontakt aufnehmen
Home » Blog » Remove navigation menu from a page in Genesis themes

Remove navigation menu from a page in Genesis themes

6. September 2022

There are several ways to remove or hide your primary and secondary navigation menus using the Genesis framework in WordPress.

The easy way is to hook into the execution via an action and remove the action responsible for the menu. To prevent the navigation menus from disappearing on all pages, a check is made beforehand to determine on which page the execution is currently taking place.

Remove primary navigation menu from home page

add_action('get_header', 'cw_child_remove_genesis_do_nav');
function cw_child_remove_genesis_do_nav() {
   if (is_home()) {
      remove_action('genesis_before_header', 'genesis_do_nav');
   }
}

If the primary navigation menu is included after the header, instead of genesis_before_header, genesis_after_header is used with remove_action (code line 4).

Sometimes it is also necessary to specify a priority parameter, as in the case of the genesis-sample-theme, if the action was registered with a priority. Line 4 then looks like this:

remove_action('genesis_header', 'genesis_do_nav', 12);

And already it works with the sample theme from Genesis.

Remove secondary navigation menu from home page

add_action('get_header', 'cw_child_remove_genesis_do_subnav');
function cw_child_remove_genesis_do_subnav() {
   if (is_home()) {
      remove_action('genesis_after_header', 'genesis_do_subnav');
   }
}

Remove primary navigation menu from a specific page

First, the ID of the page or post must be known. You can see them in the URL of the edit dialog of the page.

Edit URL page

The code to remove the main menu from the page with ID 7 looks like this:

function cw_remove_genesis_do_nav() {
   if (is_page(7) ) {
      remove_action('genesis_after_header', 'genesis_do_nav');
   }
}
add_action('get_header', 'cw_remove_genesis_do_nav');

Kategorie: Genesis Framework

Haupt-Sidebar

  • How to remove dashicons in WordPress frontend?
  • How do I create a website (homepage) with ChatGPT?
  • Can I create a website (homepage) with ChatGPT?
  • iOS restrictions re: bringing up the keyboard on programmatic focus
  • iOS restrictions re: bringing up the keyboard on programmatic focus
  • Remove user listing from WP-JSON
  • Benutzerauflistung aus WP-JSON entfernen
  • What does „Video is not the main content of the page“ mean?
  • Was hat es mit „Das Video ist nicht der Hauptinhalt der Seite“ auf sich?
  • Remove WordPress logo from toolbar
  • Efficient onboarding simplified: LearnSuite – the cloud application for digital onboarding
  • Wir stellen vor: LearnSuite – Die Cloudanwendung für digitales Onboarding
  • Howto: How do I create a website (homepage) with ChatGPT?
  • Howto: Wie erstelle ich mit ChatGPT eine Website (Homepage)?
  • Can I create a website (homepage) with ChatGPT?
  • Kann ich mit ChatGPT eine Website (Homepage) erstellen?
  • Set noindex nofollow via .htaccess HTTP header
  • Über .htaccess X-Robots-Tag noindex nofollow setzen
  • How to remove WordPress Dashicons in frontend?
  • Wie lassen sich Dashicons im WordPress-Frontend entfernen?
  • DSGVO (3)
  • GDPR (3)
  • Genesis Framework (10)
  • Genesis-Framework (9)
  • Google Search Console (4)
  • Google Search Console (4)
  • Linux (3)
  • Linux (3)
  • mobile (3)
  • Mobile (3)
  • Network (1)
  • Netzwerk (1)
  • SEO (5)
  • SEO (5)
  • Trends (3)
  • Trends (4)
  • Uncategorized (3)
  • Web development (1)
  • Web hosting (1)
  • Webentwicklung (1)
  • Webhosting (1)
  • WooCommerce (9)
  • WooCommerce (9)
  • WordPress (24)
  • WordPress (23)

Footer

Logo




© 2026 CITROWEB
  • Datenschutz
  • Impressum