Pownce: No public Pownce messages.

Agrega tu enlace

Separar trackbacks de comentarios Publicada el Martes 15 de Mayo de 2007 a las 9:58 pm por Infected-FX

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
  26.         if ('alt' == $oddcomment) $oddcomment = '';
  27.         else $oddcomment = 'alt';
  28.     ?>
  29.   <?php } // termina si es comentario ?>
  30.   <?php endforeach; ?>
  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>
  18.   <?php
  19.     if ('alt' == $oddcomment) $oddcomment = '';
  20.     else $oddcomment = 'alt';
  21. ?>
  22.   <?php } // termina si es diferente a comentario ?>
  23.   <?php endforeach; ?>
  24. </ol>
  25. <?php } // termina si trackbacks estan activas ?>

 

Páginas: 1 2 3 4 5

Otras entradas relacionadas


1 Trackbacks a este post

  1. Chicoblog » BackStage: Creacion del theme de este blog
    Enero 25, 2008 a las 09:49 pm

2 comentarios

  1. MeTaL_oRgY
    Mayo 16, 2007 a las 8:52 am

    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. Angelfire
    Agosto 4, 2008 a las 5:06 pm

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

Agregar comentario

*

*

XHTML: Puedes usar los siguientes tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Aumentar ↓ | Disminuir ↑

Sindica este sitio usando RSS

Recuerda que si quieres mantenerte informado y recibir nuestras actualizaciones agrega nuestro feed a tu lector favorito y podrás darle seguimiento a nuestro sitio.