• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Add Primary Nav Menu Class For Logged In Users & Remove When Logged Out

This PHP code enables you to add the primary nav menu class if the primary navigation is being used in the primary nav menu location and the user is logged in.

Register for full access

The benefit of using this code is that you can remove the markup which is needed for the primary nav menu when using a nav menu which is only displayed for logged in members.

This enables you to remove any gaps or spaces the menu adds when not used.

The code works in any theme and can be easily modified to work for logged out users, in other menu locations or with different conditional tags.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags