R
R
Roman_Khi2019-11-07 00:05:42
User navigation
Roman_Khi, 2019-11-07 00:05:42

Your menu options for Wordpress without plugins?

Connoisseurs, welcome!
I would like to make a multi-level menu on the site without any plugins.
At the same time, after switching to a specific parent page, the menu is replaced by child ones of the same page.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel K, 2019-11-07
@PavelK

Good day.
Um, what is the crux of the matter?
Here is the menu:

<ul>
  <li>Пункт 1 </li>
  <li>Пункт 2 </li>
</ul>

Plugins also display code and do nothing supernatural. You can rewrite it in the theme file, changing it as you need.

P
Pavel Chesnokov, 2019-11-07
@cesnokov

if ( is_front_page() || is_home() ) {
    wp_nav_menu( array( 'menu' => 'MainMenu' ) );
} else {
    wp_nav_menu( array( 'menu' => 'SubMenu' ) );
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question