• Resolved Navarro

    (@navarradas)


    Hi,

    I’ve activated the Mobile Theme module of JetPack (Minileven) which is a optimized version of Twenty Eleven Theme for mobiles.
    While in my desktop theme (customized Kirumo) I can perfectly see the menus as I organized in the Admin Menu page and changing the language (location) depending on the user language, in the mobile theme it doesn’t work.

    In the original header.php of that theme the menu is called like this:
    wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => '', 'menu_class' => 'nav-menu', 'menu' => $menu_id ) );
    In this way the menu is always showing in English because the $menu_id variable is containing the English location.

    I’ve tried also removing the ‘menu’ argument from the call and indeed I get the menu in the correct language but not the correct menu: some elements are missing, others are there when not included and the sorting is alphabetical. As I can understand the default menu of the theme is showing (only Page-type posts and their children, that’s wp_page_menu()) instead of showing my customized menu (with categories).

    In its funtions.php Minileven register the location ‘primary’ and Kirumo ‘mobile’, ‘header’, and ‘social’. Never mind which one I use as theme_location, the result is the same. Even if I remove the registration of ‘primary’ in Minieleven still the menu is the same. The only argument affecting is ‘menu’.

    How can I hack this properly?
    I’ve read some other threads but I don’t find the way to adapt it to my case.

    Thanks a lot.

    Regards.

    P.D.: I have a cache plugin but I’ve deactivated it while doing the tests.

    https://wordpress.org/plugins/polylang/

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter Navarro

    (@navarradas)

    Hi Chrystl,

    I did them with both. My screenshots are done with Kirumo without any custom code. So it’s clean.

    Anyway Chrystl, I give you thanks for your tests, but (don’t get offended, please) I think your questions are not taking me anywhere because you’re testing different things (I thing you’re using all the time a computer or something like that, not sure), otherwise I don’t understand your replies and actually it’s making me more confusing.

    So let’s describe again my issue as I did at the beginning: when I use a computer I have my normal Kirumo theme and the menus work well, changing the language when I change the language of the blog. When I use a mobile phone, JetPack theme (Minileven) is the one that rules (no Kirumo anymore) and I can only see the English menu even when I switch to Spanish the language of the blog (from the mobile phone). It looks like Polylang is not switching anymore the menu, but the rest of the blog perfectly changes the language. It’s only the menu. Not even the “Search box” that is also ruled by Minileven, so I don’t think it’s a compatibility issue between Polylang and Minileven, but something is interfering in the menu.

    What I really need to know is how Polylang changes the menu when switching the language and in what moment, so I’ll try to go deeper there.

    Regards,

    Thread Starter Navarro

    (@navarradas)

    Hi again,

    After trying to debug several times, I’ve decided to give up, I don’t have time enough. I’m pretty sure the problem is in JetPack theme and how it’s used: kind of filtering the current theme. So when Polylang attempt to get the current theme it doesn’t get the menu locations of Kirumo, but the menu locations of Minileven that is not the correct one.

    By the way, I think I’ve found out why you couldn’t see my problem. I think you’re using a big smartphone or a tablet. It looks like JetPack filter the theme by size of the screen I think.

    So given all of that I’ve decided to keep my Kirumo-child now and modify the css there instead of using JetPack Mobile Theme.

    Thanks anyway for the help.

    Regards.

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Mobile Menu JetPack not switching languages’ is closed to new replies.