After upgrade from 2.5, x-main width changed

Hi there,
We recently made a big upgrade from an old version of the theme.
Everything worked quite all right, except the main content width which seem to have changed, pushing sidebar content to the bottom, can you please advise ?
The default layout is left sidebar and content right, all pages with this template have a wrong content width. Full width pages are ok.
Thank you very much!

Here is an example of wrong behavior:

screencapture-oraalgo-envoyer-la-demande-dinformations-medicales-personnalisees-2020-04-20-16_43_59|396x500

Oh, i found something interesting : the CSS property of x-main width appears to be wrong (see screenshot): the number is set as a decimal with a coma (european notation) instead of a dot (us notation).
Should i change my web server locale ?
Capture d’écran 2020-04-20 à 17.54.58

It works manually changing to dot:
Capture d’écran 2020-04-20 à 17.55.17

any idea ?
Thanks!

The native CSS stylesheet contains:

.x-main {
 width:70,79803%;
}
.x-sidebar {
 width:22,79803%;
}

This is a bug right ?

Hello @lemret,

I checked this in my setup and the sizing of the content area are not in commas.

Please check in Pro > Theme Options > Layout and Design then make sure that the site width value does not have any comma in it.

It is also possible that a plugin conflict is causing the issue on your site so please try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

In case the issue persists, please provide us with the admin access to your site in a Secure Note:

thanks no problem in settings, please use provided credentials in previous post
Thank you!

Hello @lemret,

The given credentials only gave access to the site. The theme files were still not accessible. Please make the user credential as a Super Admin so that we can access the theme files as you may have added some custom codes in your child theme.

Thank you.

done! sorry.

Hello @lemret,

I have logged in again and investigated your issue. Even if I switched to the parent theme, the issue still exist. The Pro theme template files may have been corrupted. Please re install Pro theme. You can go to your My Sites > Network Admin > Themes. Delete Pro theme. Go to your APEX dashboard and download pro.zip. Use this latest copy to reinstall the Pro theme in your site.

We would love to know if this has worked for you. Thank you.

No it does not change anything, actually the files are identical, so not corrupted.
I think this is a bug here:

/* Layout Sizing

// ========================================================================== */

.x-main {

width: <?php echo $x_layout_content_width - 3.20197 . '%'; ?>;

}

.x-sidebar {

width: <?php echo 100 - 3.20197 - $x_layout_content_width . '%'; ?>;

}

You would have to force output to be formatted with . instead of , which may depend on platform locale.
Can you confirm ?

Hi @lemret,

I saw a similar issue and yes, it could be due to locale, especially in Europe. I’m not sure how it was fixed, but the code above is simply a subtraction of numbers, the formatting is surely done through PHP (where locale is set) and passed to CSS.

Would you mind providing your FTP login credentials as well? I like to verify something, I can’t promise any fix but if this is true, then you would need to contact your hosting provider to change it.

Thanks!

The access to the production environnement is complex (behind VPN) but i am pretty sure here is the solution:

https://www.php.net/manual/fr/language.types.float.php#58824

Please inform you developer team (i am a php developer as well), they will probably confirm it.

Can you please keep me posted if the make a new release ?

Thank you!

Hi @lemret,

Sure, we’ll check it but I can’t promise any solution as I can’t reproduce this issue on my installation. In fact, this is just the second time I see this issue, but I haven’t reproduced it on any of my installation, nor other users sites. And if it’s true, then it should be the same even in old X 2.5 since it has the same coding format.

As you said, it only happens after the update so I don’t think it’s really the cause initially, which is why I like to confirm every possible cause to confirm it including the one from your provided URL as I’ve read that before. But again, I can’t access the site so I’ll try my luck reproducing the issue on my end :slight_smile:

I also recommend updating PHP in case it’s old, that’s because that comment from that URL about float issue was 14 years ago which may have been patch. That’s why I don’t see it anymore on any of installation.

Thanks!

thank you for you reply, you are right.
Another problem occuring now on my home page: can you please advise ?

Hello @lemret,

We have checked your site and you have installed a Child theme. You are using a legacy child theme. Please move some of the template files in your child theme:

  • framework/views/global/_brand.php should be moved to framework/legacy/cranium/headers/views/global/_brand.php

  • framework/views/renew/_landmark-header.php should also be moved to framework/legacy/cranium/headers/views/renew/_landmark-header.php

We would love to know if this has worked for you. Thank you.

Thanks a lot, i will do it asap.

No file framework/views/global/_brand.php present in directory of parent theme…
The other file is not present also.

And here is my current child theme files
Capture d’écran 2020-04-30 à 14.29.23

Hello @lemret,

I am referring to the files that you have added in your child theme. You will need to relocate them to the correct folder. Please move some of the template files in your child theme:

  • wp-content/themes/x-child/framework/views/global/_brand.php” should be moved to “wp-content/themes/x-child/framework/legacy/cranium/headers/views/global/_brand.php
  • wp-content/themes/x-child/framework/views/renew/_landmark-header.php” should also be moved to “wp-content/themes/x-child/framework/legacy/cranium/headers/views/renew/_landmark-header.php

Hope this makes sense.

oups, sorry, done.
It seems ok now.

Thank you

Glad to hear it’s sorted, @lemret.