Accelerated-mobile-pages: WPML AMPHTML error

Created on 20 Oct 2017  路  4Comments  路  Source: ahmedkaludi/accelerated-mobile-pages

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">

bug

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

faia20 picture faia20  路  9Comments

chaselivingston picture chaselivingston  路  5Comments

seriou5 picture seriou5  路  5Comments

jeherve picture jeherve  路  8Comments

shchedrakov picture shchedrakov  路  3Comments