A
A
Alexander Astashov2015-11-22 02:59:12
WordPress
Alexander Astashov, 2015-11-22 02:59:12

How to create "Theme Areas" for menus?

Hello,
I created a site, everything is set up. It's time to add multilingualism, installed the plugin: Polylang, it seems like everything works, but when it came to the translation of the menu, then trouble happened, there is no " Theme Area " in the menu settings to mark each menu for different languages.
f1343547c0c24939ab91afd1c4a54c73.JPG
Although normal people automatically have labels:
bacae6257acd419c80803d57582554d3.JPG
I thought that the problem might be in the " register_nav_menu() " function, but it turned out to be even worse. It is completely absent in the topic, even in the "screen settings", there is no "Theme Area".
31cd1480669349bd99aff3201cb85004.JPG
Please tell me what could be the problem? It is necessary, in fact, only to explain Polylang, so that for different languages, it uses different menus.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Villarou, 2015-11-22
@Unicode1

So add it with the required number of menu items :)

// Add Your Menu Locations
function register_my_menus() {
  register_nav_menus(
    array(  
    	'header_navigation_rus' => __( 'Header Navigation RUS' ), 
    	'header_navigation_eng' => __( 'Header Navigation ENG' )
    )
  );
} 
add_action( 'init', 'register_my_menus' );

A
Alexander Astashov, 2015-11-22
@Unicode1

Villarou
So add it with the required number of menu items :)

That's exactly what I came up with this morning. I added everything, it works, but only the function is displayed a little incorrectly, for some reason each line is duplicated, and this is how it looks in the admin panel:
(I highlighted in red what language the area is used for). In general, it's strange, but the main thing works :)
Thank you! :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question