Fix limit on template conditionals for multilingual sites

We have a site with more than 99 languages. The headers are translated through WPML which brings forth an individual header template for each language so we have more than 99 header templates.

However your code shows that you've set a limit to 99 templates. This caused problems with some locales.

We request that you find a more elegant fix than limiting the number of locales.

The code can be found here:

wp-content/themes/betheme/functions/builder/class-mfn-builder-admin.php

around lines 3657 + 3839

It's this code:

$templates = $wpdb->get_results( "SELECT p.ID, p.post_title FROM {$wpdb->prefix}posts as p JOIN {$wpdb->prefix}postmeta as m on p.ID = m.post_id WHERE p.post_type = 'template' and p.post_status = 'publish' and m.meta_key = 'mfn_template_type' and m.meta_value = '{$type}' LIMIT 99" );


Thank you.

Comments

  • We were searching for another solution for that, but unfortunately, there is no "more elegant fix" for that.

    At the moment, I can suggest increasing this value in a child theme for your purposes, and we will increase that in our theme in the upcoming update.


    Best regards

  • The increase in the upcoming update is an elegant fix.

    Since this is a hardcoded function in the BeTheme, I would love some suggestions on how to increase the limit in the child theme.

  • To achieve that with a child theme, copy this file with the whole path to it from parent theme to child, and change the LIMIT to 200.

    When we release an update with this fix, you can remove this file to prevent possible future issues.


    Best regards

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.