WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] get local language variable in a session, maybe ?

[Resolved] get local language variable in a session, maybe ?

  • Hi
    I’m currently working on a site that uses fancybox to open a layer with an iframe over the wordpress page. The iframe loads a contact form which is just a free-standing php page that’s not part of the WordPress set-up.

    The problem I have is that I need to change the language of the labels in the contact form. Is there a langauge session variable that I can access without including all the WordPress functions in my php page ?

    … or is there a way of loading a wordpress contact form page (without the site header and footer) into the iframe ?

    thanks for any advice you can give 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • ha! I’ve just figured it out!

    For information :

    1) In the top of my theme pages (index.php) etc I put

    <?php session_start();
    /**
     * The template for displaying all pages

    2) near the top of header.php I put

    <?php $_SESSION['curr_lang'] = get_bloginfo( 'language' );
     #echo "lang = ".$_SESSION['curr_lang'];
    ?>

    3) in my external php page I put

    <?php session_start();
    echo "lang = ".$_SESSION['curr_lang']."<br />";
    ?>

    which outputs

    lang = fr-FR

    so that’s looking very promising !

    resolved

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] get local language variable in a session, maybe ?’ is closed to new replies.
Skip to toolbar