Sidebar in translations missing

I try to display the sidebars in French and English (they were there once). But it only works in German.

URL of the / my website on which the problem occurs: https://www.morga.ch/fr/shopping/, https://www.morga.ch/en/shopping/

I expected to see that the “shopping” sidebar appears on the right, as on the German version: https://www.morga.ch/bio-lebensmittel-online-bestellen/.

Instead I got: The standard sidebar with the last blog posts. The sidebars are there, but how do I display them correctly?

We also have the same problem with the sidebar on the page “Products” (https://www.morga.ch/sortiment/) or the French. (https://www.morga.ch/fr/assortiment/) and engl. (https://www.morga.ch/en/range/) version of it.

And again we have the same problem on the page “About us” (https://www.morga.ch/ueber-uns/): The sidebar is available in German, but not in English and French.

As I said, the sidebars once worked. But since the last update, they are no longer displayed in the frontend.

Hey Lypa,

I see that assigning a sidebar for each language in Appearance > Sidebars works only for 1 language now. Is this the way you’ve set up the sidebars for different languages before? Once you have confirmed, we’ll add this to our issue tracker so our development team could determine if this is a bug on our end or WPML’s.

If so, it looks like you need to programmatically assign sidebars now. As an example, I’ve assigned the Shop Sidebar to all language versions of the Shopping page. Below is the code that accomplishes that.

// Assign Sidebar

function single_post_sidebar( $sidebar ){ 
       if ( is_page( array( 9825, 9822, 9816 ) ) ) {      
           return 'ups-sidebar-shop';        
       }    
  return $sidebar;
}

add_filter( 'ups_sidebar', 'single_post_sidebar');

The numbers inside the array, array( 9825, 9822, 9816 ) are the page IDs of the language versions of the Shopping page. If you need to assign the Shop Sidebar to more pages, you need to add the page IDs in the array. Here’s how to get the page’s ID: https://theme.co/apex/forum/t/setup-how-to-locate-post-ids/59

If you also noticed, the is_page WordPress conditional tag was used in the code. You can see more conditions in WordPress’ documentation at https://codex.wordpress.org/Conditional_Tags

Hope that helps.

Hi Christian

Thank you for your response. And fixing the sidebar for the “Shops” section.

The sidebars used to work on all our pages in all languages. Now, on some pages, they are just working in one language. It is these pages:

Since I do not see the fault on our side (everything used to work just fine!), would you mind putting this on your list? I would highly appreciate it if you could also fix it on our page, like you did with the shop pages.

Thank you.

Kind Regards,
lypa

Hi Lypa,

You can use the same function provided above, you just need to replace the function name (single_post_sidebar),

The ID of the pages that you want to target (9825, 9822, 9816), see this documentation on how to locate Page/Post ID, different page language has a different ID.

And the ID of the sidebar (ups-sidebar-shop) which you can find on the custom sidebar configuration (Appearance > Sidebars)

Thanks,

Hi Friech

Coming back to your quote:

This is the setup we used since 2014, and which worked until the latest updates, shown on the example of our “About us”-Sidebar:

We generated a Sidebar “Ueber-uns” (“About-us”) in the German version, here:

Then edited the details of the sidebar in the Widget area (submenu for “About us”-section and some contact details), here:

For the contact info of the different languages, we used the “Multi-language HTML Text” Widgets. Here is the English example:

And the submenu part was translated in the “Menu” section, here:

And if I switch to the translated English version of the submenu, I can see that it is still there in the backend:

But it’s not showing on the frontend.

So that is the setup that used to work out fine for us until now and we do not understand why it does not work anymore now. Please understand that this is very frustrating for us.

So will you put this on your issues list? Or what can we do? Would be great if you could take another look at it. Thank you.

Kind Regards,
lypa

Hi lypa,

Thank you for your insight, we are going to add this to our issue tracker. Please kindly consider that at the moment the only temporary fix is what my colleagues suggested.

The issue tracker fixes take time and the fix will be introduced in the next release or later depending on the problem.

Thank you for reporting this to us, you will be able to track the possible permanent fix after the new theme version release in Changelog.

Thank you for your understanding and patience.

Hey Lypa,

I just like to add here that I have replicated the issue in my test site. Thank you for confirming that the setup worked previously. Our development team will investigate this issue further.

Thanks.

Hi there,

Thank you for your replies. I would appreciate it if this issue could be fixed as soon as possible. WPML has told me that they already reported this issue in 2017 to Themeco.

The custom sidebar in our “Actuel” (“News”) section in French is now also missing: https://www.morga.ch/fr/aktuell/. It is still available in German and English. But not in French.

And the English main navigation bar suddenly shows menu items in the wrong order (“Recipes”). And it also shows items, that do not belong there, but to a Sidebar (“All News” Dropdown).
https://www.morga.ch/en/. What is going on there???

Please understand that this feels really draining and annoying to us as clients. I would highly appreciate it if you could assist us in fixing that or, even better, fix it for us.

Thank you.

Kind Regards,
lypa

Hey lypa,

The sidebar issue will be fixed in the next release. Please kindly wait for the next release. We can’t manually fix your site as that would require custom work moreover that the change is from WPML’s part. We just adjusted the theme according to the change.

We understand that this is frustrating and we’re sorry for the inconvenience. It’s not feasible for us to do a manual fix though.

And, it’s a best practice in the whole of website development to have a website backup and staging copy of the site where updates can be tested. Every website owner should have that and please test updates in a staging server next time.

-----------------------------------------------------------------------------------

The menu issue, though might be related, is best posted as a separate thread in order to avoid confusion here. Please open up a separate thread for the menu issue and just post a link to this thread for reference.

Thank you for understanding.

Hi there Christian

Thank you for explaining.

We tested everything on our staging site first, but the sidebar issue did not occur until we updated our live site.

Can you say something about when will be the next release date? Thank you.

Kind Regards,
lypa

Hey lypa,

Regretfully, we can’t provide an ETA so it would be best to revert your live site to a previous working state using a backup.

Thanks.

Hey Christian.

Aha. Thank you for the information.

Kind Regards,
lypa

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.