Sites running on WPML multilingual return errors while navigating to amp pages if url for different languages are added as parameter, not in directories.
Issue found:
<link rel="amphtml" href="http://www.domain.com/page/?lang=en-us/amp/">
Supposed to be:
<link rel="amphtml" href="http://www.domain.com/page/amp/?lang=en-us">
If the plugin and AMP support WPML then yeah you are correct, I'm not sure if that would actually be supported though.
Working and proper endpoint is getting added in amphtml
there are still some issues with WPML's AMPHTML
if(is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){
Global $sitepress_settings;
if($sitepress_settings[ 'language_negotiation_type' ] == 3){
$wpml_url =get_permalink( get_queried_object_id() );
$explode_url = explode('/', $wpml_url);
$append_amp = 'amp';
array_splice( $explode_url, 5, 0, $append_amp );
$impode_url = implode('/', $explode_url);
$amp_url = untrailingslashit($impode_url);
}
}
is not working properly and giving wrong urls.
need to test throughly.
Working.