Forums

[resolved] Trackbacks not displaying :'( (2 posts)

  1. kReEsTaL
    Member
    Posted 10 months ago #

    Good morning,

    I'm running WP 2.7 with the Sandbox them [which I highly customized] for my webzine.

    For the Comments template (comments.php), I deleted Sandbox original one and used my blog's instead [my blog is using Big Blue theme].

    The problem is, if a single post actually has trackbacks, they do not display among the comments: worse, the number of comments does not count the trackbacks in the comments template. The strange thing is that:

    1/ I'm absolutely sure there is one trackback: I got notified by email and I can see it in the admin;

    2/ the comments_count() function does tell there is N comments + 1 trackback!

    Cf. this post, which did get a trackback yesterday night:
    http://www.lalunemauve.fr/musique/news-musicales/sorties-cd-dvd/premier-album-de-spleen-arcana-the-field-where-she-died/

    Thus the problem must be in my comments template [which I replaced many times with different templates, with no success]. Here's the one I'm using:

    <?php // Do not delete these lines
    	if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    		die ('Ne chargez pas cette page directement SVP. Merci!');
    
            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
    				?>
    
    				<p class="nocomments">Ce billet est protégé par mot de passe. Saisissez le mot de passe pour voir les commentaires.
    
    				<?php
    				return;
                }
            }
    
    		/* This variable is for alternating comment background */
    		$oddcomment = 'odd';
    ?>
    
    <!-- You can start editing here. -->
    
    <div class="boxcomments" id="bottom">
    
    <?php if ($comments) : ?>
    
    <?php 
    
    	/* Count the totals */
    	$numPingBacks = 0;
    	$numComments  = 0;
    
    	/* Loop through comments to count these totals */
    	foreach ($comments as $comment) {
    		if (get_comment_type() != "comment") { $numPingBacks++; }
    		else { $numComments++; }
    	}
    
    ?>
    
    <?php 
    
    	/* This is a loop for printing comments */
    	if ($numComments != 0) : ?>
    
    <div id="comments-title">
    	<h4 id="comments"><?php comments_number('Pas encore de commentaire', '1 commentaire', '% commentaires' );?> <span class="addacomment">(<a href="#respond">ajoutez le vôtre</a>)</span></h4>
    	<span class="rss-comments"><?php comments_rss_link(__('Flux <abbr title="Really Simple Syndication">RSS</abbr> des commentaires')); ?></span>
    </div>
    
    	<ol class="commentlist">
    	<?php foreach ($comments as $comment) : ?>
    	<?php if (get_comment_type()=="comment") : ?>
    
    <li class="clearboth" id="comment-<?php comment_ID() ?>">
    
    		<div class="readerinfo <?php if ( $comment->comment_author_email == get_the_author_email() ) echo 'myinfo'; else echo $oddcomment; ?>"><?php if(function_exists('get_avatar')){ echo get_avatar($comment, 63, 'http://kreestal.free.fr/lalunemauve/gravatar-defaut_63.gif');} ?>
    <?php comment_author_link() ?><span class="postmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('j.m.y') ?> #</a> <?php edit_comment_link('Edit',' &middot; ',''); ?></span>
    </div>
    
    		<div class="readercomment <?php if ( $comment->comment_author_email == get_the_author_email() ) echo 'mycomment'; else echo $oddcomment; ?>">
    		<?php if ($comment->comment_approved == '0') : ?>
    		<em>Merci! Votre commentaire est en attente de modération.</em>
    		<?php endif; ?>
    		<?php comment_text() ?></div>
    
    	<?php /* Changes every other comment to a different class */
    	if ('alt' == $oddcomment) $oddcomment = '';
    	else $oddcomment = 'odd';
    	?>
    </li>
    
    	<?php endif; endforeach; ?>
    
    	</ol>
    
    	<?php endif; ?>
    
    <?php
    
    	/* This is a loop for printing trackbacks if there are any */
    	if ($numPingBacks != 0) : ?>
    
    	<ol class="tblist">
    
    	<li><h2 id="trackbacks"><?php _e($numPingBacks); ?> Trackback(s)</h2></li>
    
    <?php foreach ($comments as $comment) : ?>
    <?php if (get_comment_type()!="comment") : ?>
    
    	<li id="comment-<?php comment_ID() ?>">
    		<?php comment_date('j.m.y') ?>: <?php comment_author_link() ?>
    		<?php if ($comment->comment_approved == '0') : ?>
    		<em>Merci! Votre commentaire est en attente de modération.</em>
    		<?php endif; ?>
    	</li>
    
    	<?php if('odd'==$thiscomment) { $thiscomment = 'even'; } else { $thiscomment = 'odd'; } ?>
    
    <?php endif; endforeach; ?>
    
    	</ol>
    
    <?php endif; ?>
    
    <?php else : 
    
    	/* No comments at all means a simple message instead */
    ?>
    
    <?php endif; ?>
    
    <?php if (comments_open()) : ?>
    
    	<?php if (get_option('comment_registration') && !$user_ID ) : ?>
    		<p id="respond" class="comments-blocked">Vous devez être <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">identifié(e)</a> pour poster un commentaire.
    
    	<?php else : ?>
    
    	<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <div id="comments-respond"><h4 id="respond">Ajouter un commentaire</h4></div>
    
    	<?php if ($user_ID) : ?>
    
    	<p class="loggedin">Vous êtes identifié(e) en tant que <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <span class="logout">(<a href='<?php echo wp_logout_url(); ?>'>Se déconnecter?</a>)</span>
    
    <?php else : ?>	
    
    		<label for="author">Nom <span>ou</span> Pseudo<?php if ($req) _e(' <span class="obligatoire">*</span>'); ?> :</label>
    		<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
    
    		<label for="email">Email<?php if ($req) _e(' <span class="obligatoire">*</span>'); ?> <span class="notpublished">(ne sera pas publié)</span> :</label>
    		<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" tabindex="2" size="22" />
    
    		<label for="url">URL de votre site web :</label>
    		<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    
    	<?php endif; ?>
    
    		<label for="comment">Votre commentaire<?php if ($req) _e(' <span class="obligatoire">*</span>'); ?> :</label>
    <textarea name="comment" id="comment" cols="5" rows="10" tabindex="4"></textarea>
    
    		<p class="form-option"><?php do_action('comment_form', $post->ID); ?>
    
    		<p class="form-submit"><input name="submit" type="submit" id="submit" tabindex="5" value="Publier le commentaire" />
    		<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    
    	</form>
    
    <?php endif; // If registration required and not logged in ?>
    
    <?php else : // Comments are closed ?>
    	<p id="comments-closed" class="loggedin">Désolé, les commentaires sont fermés pour ce billet.
    
    <?php endif; ?></div>

    Can anybody help me, please? (And yes, the "show trackbacks" options are all on.)

    Thanks a lot in advance!

    kReEsTaL

  2. kReEsTaL
    Member
    Posted 9 months ago #

    Ok, I finally got it right by deactivating the plugin "Separate pings and comments". Anyway my theme already seperates them, so it was useless!

Reply

You must log in to post.

About this Topic