- Codice: Seleziona tutto
<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<h3><?php _e("Questo post è protetto da password. Inserisci la password per visualizzare i commenti."); ?></h3>
<?php
return;
}
}
$commentalt = '_alt';
$commentcount = 1;
?>
<div id="comment-temps">
<h2><?php comments_number('Nessun utente a', '1 utente ha', '% utenti hanno' );?> commentato " <?php the_title(); ?> " </h2>
<p><!-- google adsense --></p>
<div class="post-fixed"></div>
<?php if ($comments) : ?>
<?php foreach ($comments as $comment) : ?>
<div class="com-box<?php echo $commentalt; ?>">
<div class="author_avatar"><?php if(function_exists('get_avatar')) { echo get_avatar($comment, '40'); } ?></div>
<div class="com-box-small">
<div class="author_com"><?php comment_author_link(); ?> ha detto,</div>
<div class="author_date">
in <?php comment_date('F jS, Y') ?> alle <?php comment_time() ?> <?php edit_comment_link('modifica','',''); ?>
</div>
<div class="author_com_text">
<?php comment_text() ?>
</div>
</div></div>
<div class="com-fixed"></div>
<?php
($commentalt == "_alt")?$commentalt="":$commentalt="_alt";
$commentcount++;
?>
<?php endforeach; /* end for each comment */ ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
<?php if (get_option('comment_registration') && !$user_ID) : ?>
<?php else : ?>
<?php if ($comment->comment_approved == '0') : ?>
<p><?php _e("Commento in attesa di moderazione."); ?></p>
<?php endif; ?>
<div class="com-fixed"></div>
<p><!-- google adsense --></p>
<h3>Commenta</h3>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">
<?php if (!$user_ID) : ?>
<div id="comment-box">
<p><input name="author" type="text" value="<?php echo $comment_author; ?>"/> Nome (obbligatorio)</p>
<p><input name="email" type="text" value="<?php echo $comment_author_email; ?>"/> Email (obbligatorio)</p>
<p><input name="url" type="text" value="<?php echo $comment_author_url; ?>"/> Sito Web (facoltativo)</p>
</div>
<?php endif; ?>
<div id="comment-area">
<p><textarea name="comment" cols="50%" rows="8"></textarea></p>
<p><input name="submit" type="submit" value="Invia il commento" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p>
</div>
</form>
<span class="rssfeed">
<?php comments_rss_link('Avvisami via RSS della notifica di nuovi commenti'); ?></span>
<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>
</div>
Nel caso il lavoro non fosse fattibile sarei disposto a installare il plugin WP-Paginate che tra le altre cose permette di dividere anche i commenti. Tuttavia nelle istruzioni ufficiali viene espressamente indicato di individuare le seguenti stringe:
1. previous_comments_link()
2. next_comments_link()
sostituendole con il codice seguente:
- Codice: Seleziona tutto
<?php if(function_exists('wp_paginate_comments')) {
wp_paginate_comments();
} ?>
Come potete vedere nel mio comment.php le strighe 1 e 2 non sono assolutamente presenti, e se provo a inserire solo il codice indicato viene visualizzata la paginazione (pagine: 1,2,3, eccc) ma i commenti rimangono tutti nella stessa pagina. Magari esiste un'anima pia che riesce ad aiutarmi ? ringraziandovi anticipatamente porgo cordiali saluti.