Separar trackbacks de comentarios

15 / mayo / 2007

Por si se hicieron pelotas con la explicación aquí les dejo el código completo de como quedarían tanto los comentarios como los trackbacks. También podrán encontrar el archivo de comments.php para descargarse.

Comments

PHP:
  1. <h3 id="comments">
  2.   <?php comments_number('No Responses', 'One Response', '% Responses' );?>
  3.   to &#8220;
  4.   <?php the_title(); ?>
  5.   &#8221;</h3>
  6. <ol class="commentlist">
  7.   <?php foreach ($comments as $comment) : ?>
  8.   <?php if (get_comment_type() == "comment"){ // si son comentarios  ?>
  9.   <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"> <cite>
  10.     <?php comment_author_link() ?>
  11.     </cite> Says:
  12.     <?php if ($comment->comment_approved == '0') : ?>
  13.     <em>Your comment is awaiting moderation.</em>
  14.     <?php endif; ?>
  15.     <br />
  16.     <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title="">
  17.     <?php comment_date('F jS, Y') ?>
  18.     at
  19.     <?php comment_time() ?>
  20.     </a>
  21.     <?php edit_comment_link('e','',''); ?>
  22.     </small>
  23.     <?php comment_text() ?>
  24.   </li>
  25.   <?php /* Changes every other comment to a different class */
  26.         if ('alt' == $oddcomment) $oddcomment = '';
  27.         else $oddcomment = 'alt';
  28.     ?>
  29.   <?php } // termina si es comentario ?>
  30.   <?php endforeach; /* end for each comment */ ?>
  31. </ol>

 

Trackbacks

PHP:
  1. <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // SI 'TRACKBACKS' ESTAN ACTIVAS ?>
  2. <h3 id="trackbacks">Trackbacks/Pings</h3>
  3. <ol class="commentlist">
  4.   <?php foreach ($comments as $comment) : ?>
  5.   <?php if (get_comment_type() != "comment"){ // si es diferente a comentario ?>
  6.   <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"> <cite>
  7.     <?php comment_author_link() ?>
  8.     </cite> Says: <br />
  9.     <small class="commentmetadata"> <a href="#comment-<?php comment_ID() ?>" title="">
  10.     <?php comment_date('F jS, Y') ?>
  11.     at
  12.     <?php comment_time() ?>
  13.     </a>
  14.     <?php edit_comment_link('e','',''); ?>
  15.     </small>
  16.     <!-- <?php comment_text() ?> -->
  17.   </li>[download id="48"]
  18.   <?php /* Changes every other comment to a different class */
  19.     if ('alt' == $oddcomment) $oddcomment = '';
  20.     else $oddcomment = 'alt';
  21. ?>
  22.   <?php } // termina si es diferente a comentario ?>
  23.   <?php endforeach; /* end for each trackbacks */ ?>
  24. </ol>
  25. <?php } // termina si trackbacks estan activas ?>

 

Download

Páginas: 1 2 3 4 5

+

2 comentarios para Separar trackbacks de comentarios

  1. Se va a la enorme (y creciente) lista de cosas por hacer; pero ya con este tutorial será más rápido. ¡¡Muchas gracias brother!!

  2. No veo el archivo comments.php que comentas para descargar :(

ShowTracksTrackbacks/Pings

  1. [...] Separar TrackBacks de los Comentarios Por Infected-Fx [...]

Agrega tu opinión Invitado, tu puedes registrarte o ingresar a tu cuenta .

No será publicado

Get your own Gravatar
Sign up for free