0

I am using a premium theme on my page. The theme only accepts one menu in the whole site.

The site is a single page site. And the way the theme works is that we have to set up a Home Page and then use the Menu items in order to make the sections of the site.

So, I created a Menu with all the sections I want to have using pages I created already set up as sections. So for example: I have Home, Photos, Videos, etc. These are individual pages but when I include them as part of the menu they will appear one below the other one in a single page and the menu items will scroll to that anchor on that single page.

Many themes work like that.

My problem is :

I need to translate the menu OR set up another page (not as section, but a normal independent page) with a different menu with the items linking to anchors on that page and not the Main Page.

I'm asking this mainly because I want to have the site in two different languages. So I have a main page (In English) with a normal Menu and one of the Items of the Menu is not a section but a link to the second language (Spanish). I can easily make a page and declare it as a Single Page and not a section but then, when the menu appears in that page it's in English and those links are linking to the Main Page sections in English.

I already made the translation myself and I want to have my own translation not an automated one. My page is mainly informative and the text almost never changes.

I do not want to pay for the WPML plugin and the other free plug ins out there aren't any good. It's such a simple thing and I can't find a way around it.

2 Answers 2

0

I'm not sure, but if I understand correctly you should create a second menu which is only visible on your Spanish language page.

if (is_page($english_page_id)) {
    wp_nav_menu( array('menu'=>$english_menu) );
} 
if (is_page($spanish_page_id)) {
    wp_nav_menu( array('menu'=>$spanish_menu) )
}

is_page()
wp_nav_menu()

2
  • Hi Florian, Thank you for your answer. I've seen examples like that before. So, If I did that, where would I paste the code? (I mean which file? - Where about in the file?) Thank you!
    – John
    Mar 16, 2018 at 19:19
  • Search your theme for occurrences of wp_nav_menu, then put my code where you want the translated menu to appear.
    – Florian
    Mar 19, 2018 at 9:26
-1

There are good plugins for this without paying...

But you can also (which you should have already) create a child theme. Add another menu in the child functions and create custom links.

Keep in mind that this is extremely high-maintenance.

Besides that this is just a crappy work around

3
  • Hi, Thanks for your answer. Unfortunately, there aren't any good free plug-ins that I can use. In fact, the only plug-in that dos exactly what I need is WPML. I can't afford to pay for it as it is an annual fee and when you don't pay the whole translation disappears.
    – John
    Mar 16, 2018 at 14:07
  • The whole thing doesn't disappears but you just can't update. Anyhow I also like Loco Translate wordpress.org/plugins/loco-translate Mar 16, 2018 at 14:15
  • Yes, I know that one too. But it doesn't do what I need. I don't need localization, or work with PO files nor string translation. I need to have a way to insert a different menu on a different page under the same site OR translate the whole menu (including the actual links) just for one page only. (The rest will stay as it is. As i explain in my query).
    – John
    Mar 16, 2018 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.