Visualizzazione 0 filoni di risposte
Visualizzazione 0 filoni di risposte
- Devi essere connesso per rispondere a questo topic.
Email: info@wpitaly.it
Home › Forum › Problemi Vari con WP › Rilevare url sito in WP
Buonasera a tutti.
Ho realizzato un sito web e sfruttando il plugin Polylang ho realizzato la versione inglese dello stesso.
Ora però ho questo problema:
La homepage del sito si basa su un file di template unico (cosଠprevede il tema).
Ho notato che se sono nella homepage del sito in italiano l’url del sito è: http://www.nomesito.it
mentre se sono nella versione inglese del sito l’url diventa: http://www.nomesito.it/en/ per la homepage
oppure http://www.nomesito.it/en/products/ per la pagina prodotti
per cui avevo pensato di rilevare la parte dell’url che mi fa identificare di essere nella versione inglese del sito e (modificando il template della homepage previsto dal tema) a seconda del caso caricare lo slider nella versione italiana o nella versione inglese.
Esempio:
$urlSito = RILEVA-PRIMA-PARTE-DELL-URLSITO
switch ($urlSito) {
case “www.nomesito.it”:
carica sliderITA;
break;
case “www.nomesito.it/en/”:
carica sliderEN;
break;
}
Purtroppo però non sono molto pratico dell’uso del php e dei codici di WordPress perché sto imparando da poco a farne uso.
Qualcuno più pratico di me potrebbe darmi un aiuto?
Grazie in anticipo
WPItaly - Copyright Creative Commons: CC BY-NC-SA 4.0