I have a custom page on my site (access.php) and that page offers language support, for example access.php?lang=es for Spanish.
I want the link in the menu to be dynamic, so for example
if ( !empty( $_REQUEST['lang'] ) ) {
//if ( 1 === 1 ) {
$output = 'access.php?lang=' . $_REQUEST['lang'] ;
} else { $output = 'access.php'; }
return $output;
}
add_shortcode( 'av_access_lang', 'avia_access_lang' );
I tried creating a shortcode and putting that as the menu URL. Didn’t work.
When I put the shortcode in the menu: [avia_access_lang], it gets changed to http://[avia_access_lang]
maybe you have a better method. Thanks
I think I figured it out… since each language has its own menu, just edit the URL in each menu like so:
ENGLISH: http:/whatever.com/access.php
SPANISH http:/whatever.com/access.php?lang=es
BR PORT http:/whatever.com/access.php?lang=pt-br
I think I just need to be careful when synchronizing the menus not to include the URL.
Hi,
glad you could figure it out. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.
Best regards,
Andy