Ho apportato una modifica e sembra funzionare, però non ho capito il perché, mi puoi spiegare tu?
Questo è il codice originale:
Codice PHP:
<?php
if (1 == get_comments_number()) {
printf(__('<a href="' . get_permalink() . '#comments"> 1 commento</a>', 'wp-portfolio') , number_format_i18n(get_comments_number()));
}
else {
printf(__('<a href="' . get_permalink() . '#comments"> %1$s commenti</a>', 'wp-portfolio') , number_format_i18n(get_comments_number()));
}
?>
Io ho solamente sostituito l'1 con 0 (vedi l'if) e poi il testo del primo printif() però a video se c'è un solo commento lo scrive al plurale (1 commenti)
Codice PHP:
<?php
if (0 == get_comments_number()) {
printf(__('<a href="' . get_permalink() . '#comments"> Scrivi un commento</a>', 'wp-portfolio') , number_format_i18n(get_comments_number()));
}
else {
printf(__('<a href="' . get_permalink() . '#comments"> %1$s commenti</a>', 'wp-portfolio') , number_format_i18n(get_comments_number()));
}
?>