 samM-20
|
I set up a redirect.php in the domain's main directory with the only content
<?php
/*
Template Name: Root redirect
*/
wp_redirect( home_url() );
exit;
?>
But WPML seems not to accept that as an html default page in language settings, neither by entering redirect.php nor by /redirect.php.
|
 Marcel
Supporter
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
Europe/Madrid (GMT+02:00)
|
Hi,
Please refer to this link for more details: WPML Language Setup.
The root page as a WordPress page doesn't have built-in styling options, so all styling must be applied manually via code.
You can add the necessary HTML file to the root directory of your installation without making any changes to the theme folder.
Best regards,
Marcel
|
 samM-20
|
I really appreciate your support and I feel terribly sorry for being still stuck.
The option with the WP page seems not to work since I can not select a template in the page settings. Maybe because of Astra theme?
The html file option seems not to work – I placed a file with the content you specified, but only got a different error message.
Any more hints or ideas?
(Feeling so stupid.)
|
 samM-20
|
Here's the error message shown on the website's root:
Warning: include(/redirect.php): Failed to open stream: No such file or directory in /home/httpd/vhosts/***.com/***.com/wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/redirection/wpml-rootpage-redirect-by-subdir.class.php on line 45 Warning: include(/redirect.php): Failed to open stream: No such file or directory in /home/httpd/vhosts/***.com/***.com/wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/redirection/wpml-rootpage-redirect-by-subdir.class.php on line 45 Warning: include(): Failed opening '/redirect.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/httpd/vhosts/***.com/***.com/wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/redirection/wpml-rootpage-redirect-by-subdir.class.php on line 45
|
 Marcel
Supporter
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
Europe/Madrid (GMT+02:00)
|
Hi,
No worries! It looks like the procedure wasn't quite right, but you can try the following steps:
1) Create a file named "root-page.html" and save it in the root folder of your server (the same location as the redirect.php file). Make sure there are no empty spaces, so the file is starting on line 1.
2) Open the WPML settings and simply enter "root-page.html" without adding a forward slash ("/"). You can see a screenshot of this step hidden link redirect.png">here.
3) Lastly, resave your WordPress permalinks (WPML will prompt you to do this and provide a link).
Best Regards,
Marcel
|
 samM-20
|
That finally worked. Thanks so much for your support and being patient!
|
 samM-20
|
By the way: we now have a root page, so the front end works properly. But the original issue was still not solved. We still see the error message at > WPML > languages
Warning: Undefined property: stdClass::$menu_id in /home/httpd/vhosts/***.com/***.com/wp-content/themes/astra/inc/extras.php on line 508 Warning: Undefined property: stdClass::$menu_id in /home/httpd/vhosts/***.com/***.com/wp-content/themes/astra/inc/extras.php on line 546 Warning: Undefined property: stdClass::$menu_id in /home/httpd/vhosts/***.com/***.com/wp-content/themes/astra/inc/extras.php on line 508 Warning: Undefined property: stdClass::$menu_id in /home/httpd/vhosts/variaduna.com/***.com/wp-content/themes/astra/inc/extras.php on line 546
|
 Marcel
Supporter
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
Europe/Madrid (GMT+02:00)
|
Hi,
Could you please provide a Duplicator copy of your site for further debugging? This will help us investigate why, despite all requirements being met now, the Astra theme is still causing an error on our GUI endpoint.
Thanks!
Best regards,
Marcel
|
 Marcel
Supporter
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
Europe/Madrid (GMT+02:00)
|
Thank you! You can go ahead and remove the file now. This was helpful in allowing me to reproduce the issue from scratch and escalate it to our compatibility team, who will contact the theme authors to get it resolved in their code.
In the meantime, I’ve found a temporary workaround you can apply. By checking if the menu_id property exists in the $args object using isset(), we can avoid the error when the property is undefined.
You can temporarily update the following lines in the /wp-content/themes/astra/inc/extras.php file:
Line 513:
if ( isset( $args->menu_id ) && in_array( $args->menu_id, $astra_menu_locations ) ) {
Line 536:
$is_special_menu = isset( $args->menu_id ) && in_array( $args->menu_id, $special_menu_ids );
Best Regards,
Marcel
|
 samM-20
|
Since we know it's treated by you: if there is only the admin user interface issue we'll be fine with it for the moment. Do you see any potential frontend side effects we should catch with the two code lines?
|
 Marcel
Supporter
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
Europe/Madrid (GMT+02:00)
|
Currently, I haven't noticed any side effects. I’ve tested it locally, but it might be best to wait a few more days until our compatibility team contacts Astra, as they may resolve the issue quickly.
Best regards,
Marcel
|
 Marcel
Supporter
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
Europe/Madrid (GMT+02:00)
|
Currently, I haven't noticed any side effects. I’ve tested it locally, but it might be best to wait a few more days until our compatibility team contacts Astra, as they may resolve the issue quickly.
Best regards,
Marcel
|
 Marcel
Supporter
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
Europe/Madrid (GMT+02:00)
|
This was solved with Astra hidden link">4.8.4:
Resolved issue causing warnings in Astra when WPML is active.
Best regards,
Marcel
|
 samM-20
|
Marcel:
Thanks so much for your heads up comment here!
|