Risposte nei forum create
-
AutorePost
-
7 Maggio 2008 alle 20:57 in risposta a: template (o semplice nome) alternativo per i commenti di alcune pagine #53469hanslukasPartecipante
Ottimo, l’ho appena testato…
funziona!
ps: ganzo l’OR !!!
Direi che possiamo fermarci…
Riassumendo, le versioni funzionanti sono queste due:
1.
<div id="comments-list" class="comments">
<h3>
<?php if (is_page('17')) {
echo "Contributo";
} elseif (is_page('16')) {
echo "Contributo";
} else {
printf($comment_count > 1 ? __('<span>%d</span> Comments', 'sandbox') : __('<span>One</span> Comment', 'sandbox'), $comment_count);
}
?>
</h3>
2.
<div id="comments-list" class="comments">
<h3>
<?php if ( is_page(16) || is_page(17) ) {
echo "Contributo";
} else {
printf($comment_count > 1 ? __('<span>%d</span> Comments', 'sandbox') : __('<span>One</span> Comment', 'sandbox'), $comment_count);
}
?>
</h3>
Buonanotte a tutti
g
7 Maggio 2008 alle 19:16 in risposta a: template (o semplice nome) alternativo per i commenti di alcune pagine #53464hanslukasPartecipantecaxxo lo sapevo!!!!!
non ce l’ho fatta per un PUNTO E VIRGOLA…
A parte le stupidaggini,
GRAZIE MILLE SteveAgl
Preciso però che:
se inserisco il ; mancante funziona perfettamente…
Se semplifico con l’array invece non va…
non mi da alcun errore… però non compare CONTRIBUTO…
Per quello che dovevo ottenere io, va già bene il fatto che funzioni con il primo consiglio… però a vantaggio di chi leggerà forse è il caso di verificare perchè questa seconda sintassi non va…
anche perchè in realtà è più economica… basta inserire un ID in più separandolo con virgola…
Che cosa manca?
31 <div id="comments-list" class="comments">
32 <h3>
33 <?php if (is_page(array(17,16))) {
34 echo "Contributo";
35 } else {
36 printf($comment_count > 1 ? __('<span>%d</span> Comments', 'sandbox') : __('<span>One</span> Comment', 'sandbox'), $comment_count)
37 }
38 ?>
39 </h3>
Ad ogni modo,
un grazie a SteveAgl e un saluto a tutti...
g
7 Maggio 2008 alle 17:27 in risposta a: template (o semplice nome) alternativo per i commenti di alcune pagine #53457hanslukasPartecipanteHo consultato il Wiki alla sezione dei Tag Condizionali e ho provato la dritta di SteveAgl, ma ottengo errore…
ecco i dettagli delle mie operazioni…
cosa sbaglio?
Qui comments.php genera la parola COMMENTI quando ci sono
31 <div id="comments-list" class="comments">
32 <h3><?php printf($comment_count > 1 ? __('<span>%d</span> Comments', 'sandbox') : __('<span>One</span> Comment', 'sandbox'), $comment_count) ?></h3>
Per fargli dire CONTRIBUTI in certe pagine ho provato a fare cosà¬
31 <div id="comments-list" class="comments">
32 <h3>
33 <?php if (is_page('17')) {
34 echo "Contributo";
35 } elseif (is_page('16')) {
36 echo "Contributo";
37 } else {
38 printf($comment_count > 1 ? __('<span>%d</span> Comments', 'sandbox') : __('<span>One</span> Comment', 'sandbox'), $comment_count)
39 }
40 ?>
41 </h3>
Ottengo questo errore
Parse error: syntax error, unexpected '}' in MIOBLOGwp-contentthemesMIOTEMAcomments.php on line 39
Qualche consiglio???
Grazie a tutti
g
-
AutorePost