Multi language sites and the index.php

Discussion in 'PHP' started by toucan1, Dec 10, 2009.

  1. #1
    Hello

    I am trying to run a site with several languages in wordpress. I have edited the index.php file (badly) to show the content in English.

    I want to show the content in my other language (spanish).

    Two things: I want to first write the content for the spanish site and put in in the Index.php- not sure WHERE I should put it.

    Then I want the flag link to go to the spanish version of the homepage.

    I have a plugin installed for this. qtranslate. I have followed the instuctions- such as 'edit html' for the homepage and "Use Query Mode (?lang=en)" on "URL Modification Mode".


    I followed some instructions about how to do this but messed up my index.php!

    Any idea if this is correct code and where it should go?

    <?php if (qtrans_getLanguage()=="es"): ?>
    <li><a href="<?php echo get_option('home'); ?>/?lang=es">Home ES</a></li>
    <?php endif; ?>

    I have
    Use Query Mode (?lang=en)" on "URL Modification Mode" (wp--> admin--> settings--> languages--> Advanced Settings)


    if (qtrans_getLanguage()=="es")
    { $lang_select = "";
    $home_link = "inicio";}

    elseif (qtrans_getLanguage()=="en") {
    $lang_select = "/en";
    $home_link = "home"; }

    endif; ?>
     
    toucan1, Dec 10, 2009 IP
  2. peter_anderson

    peter_anderson Notable Member

    Messages:
    3,382
    Likes Received:
    152
    Best Answers:
    0
    Trophy Points:
    240
    #2
    Please use the [php][/php] code when posting your code.

    Then, we can have a better look :)
     
    peter_anderson, Dec 11, 2009 IP