How does Tinection display a multi-level/infinite-level navigation menu?

someone just learningWordPress websiteFriends, test using the WordPress Tinection theme.

  • It was found that the WordPress theme (Tinection) can only display the secondary navigation menu by default...
  • If you want to display more menus, and you want to manually modify the WordPress code, it is difficult for a novice who is just learning to build a website...

以下Chen WeiliangShared "Knowledge theme Tinection display multi-level/unlimitedHow to modify the "Hierarchical Navigation Menu".

Step 1:Modify the styles in the style.css file 

Open the style.css file and add the following styles▼

.pri-nav ul ul ul {left: -999em; top: 0;}

change to ▼

.pri-nav ul ul ul {left:125px; top: 0;}

Step 2:Modify the code in the header.php file

Open the header.php file and insert the following code▼

<?php wp_nav_menu( array( 'theme_location' => 'topbar', 'menu_class' => 'nav-menu', 'depth' => '2' ) ); ?>

change to ▼

<?php wp_nav_menu( array( 'theme_location' => 'topbar', 'menu_class' => 'nav-menu', 'depth' => '0' ) ); ?>
  • 'depth' => '0' means display infinite levels.

The following is the WordPress Tinection navigation menu, showing infinite levels of display ▼

The WordPress theme Tinection features a navigation menu with an infinite number of levels.

Extended reading ▼

Comment

Your email address will not be published. Required fields * Callout

Scroll to Top