Documentazione > Componenti aggiuntivi > Language by GET parameter

Language by GET parameter

Sfoglia documenti
Cerca Documentazione
Note: This addon and functionality is no longer supported. Please use WordPress permalinks with TranslatePress.

WARNING: This is an experimental add-on designed for websites that do not have pretty permalinks enabled. Using this URL language parameter might cause unexpected side effects and its usage is not recommended.

If your website doesn’t have pretty permalinks available you can still use TranslatePress by installing an add-on.

Sul Language by GET parameter Add-on you can encode language in the URL as a GET parameter. Your website will use URLs such as this one:

http://www.example.com/?lang=en

This will replace the language directory system which uses the following URL format:

http://www.example.com/en/

There is no need for extra configuration. You just have to activate it and that’s it.

Download Language by GET parameter Add-on

The default GET parameter used is lang. This can be changed using a bit of coding:

  • Crea un plugin vuoto come questo: https://gist.github.com/sareiodata/76f701e01db6685829db
  • Aggiungi il seguente codice alla fine di esso:
    add_filter( 'trp_gp_lang_parameter', 'trp_gp_change_parameter_name' );
    function trp_gp_change_parameter_name( $name ){
          return 'language';
    }
  • Sostituisci language with the GET parameter of your choice.
  • Installa questo plugin tramite FTP (copialo all'interno di wp-content/plugins) o crea un archivio zip con esso e installalo tramite la funzionalità di caricamento dei plugin di WordPress.

TranslatePress Multilingue

Il miglior servizio di localizzazione di siti web per siti web WordPress. Gestisci tutto da un'interfaccia visiva.