Redirection loop once using wp_redirect in functions.php
-
Please I have faced ia problem with wp_redirect function, it is giving redirect loop once called in functions.php and here is the code:
add_action(‘wp_loaded’, ‘my_icl_set_current_language’);
function my_icl_set_current_language($lang) {
global $sitepress;wp_redirect( ‘https://www.alwadi-alakhdar.com/?lang=fr’ );exit();
}website url: https://www.alwadi-alakhdar.com
The website is using WPML plugin, but I have disabled all plugins by renaming the plugin folder and the issue mentioned is still appearing.
I have tried also to call wp_redirect using “init” filter and even from the header.php , but none of these ways solve the problem.So please can you please help me concerning this issue as soon as possible since this is URGENT.
Thank you in advance,
- The topic ‘Redirection loop once using wp_redirect in functions.php’ is closed to new replies.