Home › Forum › Plugin e temi di WP › Gestione lingua
Visualizzazione 0 filoni di risposte
-
AutorePost
-
-
31 Gennaio 2012 alle 10:26 #20542SmiaoPartecipante
Ciao a tutti,
sto realizzando un tema os e ho un problema forse banale ma che non so come affrontare.
L’indirizzo del tema è http://www.somesay.it.
Vengo al dunque:
Nel file function.php ho questo:
.......
<tr valign="top">
<th scope="row"><label for="home_box1">Box 1</label></th>
<td>
<?php wp_dropdown_pages("name=home_box1&show_option_none=".__('- Select -')."&selected=" .get_option('somesay_home_box1')); ?>
</td>
</tr>
......
nel file index.php ho invece:
............
<div id="box">
<?php $box1=get_post(get_option('somesay_home_box1'));
$box2=get_post(get_option('somesay_home_box2'));
$box3=get_post(get_option('somesay_home_box3'));
if(get_option('somesay_home_box1')!= null && get_option('somesay_home_box2')!= null && get_option('somesay_home_box3')!= null){?>
<p>
<?php $pagelink = get_permalink($box1->ID, 'pagelink', true); ?>
<span>"><?php echo $box1->post_title?></span>
<?php echo apply_filters('get_the_excerpt', $box1->post_excerpt);?>Â
">Leggi »
</p>
<p>
<?php $pagelink = get_permalink($box2->ID, 'pagelink', true); ?>
<span>"><?php echo $box2->post_title?></span>
<?php echo apply_filters('get_the_excerpt', $box2->post_excerpt);?>
">Leggi »
</p>
<p>
<?php $pagelink = get_permalink($box3->ID, 'pagelink', true); ?>
<span>"><?php echo $box3->post_title?></span>
<?php echo apply_filters('get_the_excerpt', $box3->post_excerpt);?>Â
">Leggi »Â
</p>
<?php }?>
</div>
.................
Funziona tutto perfettamente, ma il problema sorge installando il plugin q-translate.
In index mi viene stampato sia il titolo/testo in italiano che in Inglese.
Come posso filtrare la lingua?
Grazie mille a chiunque. ( prometto una citazione nel pannello di controllo del tema.)
Aggiornamento:
forse avrei trovato questa soluzione
.......
<?php if (qtrans_getLanguage() == 'it') { ?>...............<?php } ?>
<?php if (qtrans_getLanguage() == 'en') { ?>...............<?php } ?>
............
Però ha evidenti problemi, perche costringerebbe a mettere le mani sul codice per ogni lingua, oppure ad avere codice di troppo se il sito è in una sola lingua.
-
-
AutorePost
Visualizzazione 0 filoni di risposte
- Devi essere connesso per rispondere a questo topic.