Error with Polylang plugin
-
After installing the Polylang plugin
I am encountering a fatal error on Arabic pages: PHP Fatal error: Uncaught Error: Call to undefined function formula_generate_css() in /home/mysti/public_html/wp-content/themes/formula/theme-menu/classes/class-formula-non-latin-languages.php:117.
This issue arises when creating or viewing Arabic pages after installing a multilingual plugin.
I have traced theformula_generate_css()function to the parent theme’s/assets/css/custom-css.phpfile, which is included in the parent theme’sfunctions.php.
I found that/theme-menu/menu-file.php(which loads the problematic class) seems to be included infunctions.phpbefore/assets/css/custom-css.php. You even tried reordering these lines in the parent theme’sfunctions.php, but the error persisted.I also tried to force-load
custom-css.phpearly in the child theme’sfunctions.php, but this didn’t resolve the issue either.<?php
/**
- Force load parent theme’s custom-css.php very early.
*/
function my_child_force_load_custom_css() {
require_once get_template_directory() . ‘/assets/css/custom-css.php’;
}
add_action( ‘after_setup_theme’, ‘my_child_force_load_custom_css’, 1 );
/**
- Now load the parent theme’s menu file (which includes the problematic class).
*/
function my_child_load_menu_file() {
require_once get_template_directory() . ‘/theme-menu/menu-file.php’;
}
add_action( ‘after_setup_theme’, ‘my_child_load_menu_file’, 11 ); // Ensure this runs after our forced load
So I need your guidance on properly resolving this conflict within their theme, ensuring compatibility with multilingual setups.
BTW, I am using elementor plugin to build my site
- Force load parent theme’s custom-css.php very early.
The topic ‘Error with Polylang plugin’ is closed to new replies.
