Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #768477

    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

    #768492

    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.

    #770065

    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

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Enfold, dynamic URL in a href of menu – based on $_REQUEST['lang']’ is closed to new replies.