8

Dar estilo a tus Comentarios Wordpress

Publicado por Nikko el dia 8 Jul 2008 - Guardado en 676 Views php, CSS, WordPress, Tutoriales, Diseño Web 676 Views

commentsestilo.jpg

Si piensas rediseñar por completo tu blog, no estaría nada mal, dedicar tiempo a elaborar cosas creativas para los comentarios de tu blog. Partiendo de esa idea, encuentro en darrenhoyt, algunos prácticos ejemplos que podrás utilizar como base, donde se incluyen inclusive ejemplos de códigos y la posibilidad de los PSD originales.
Ampliar info y mas ejemplos Styling Your Wordpress Comments
Lo primero será, editar tu archivo "comments.php" de tu theme wp:

PHP:
  1. <ol class="commentlist">
  2. <?php foreach ($comments as $comment) : ?>
  3. <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
  4. <div class="commenttext">
  5. <cite><?php comment_author_link() ?></cite>
  6. <?php comment_text() ?>
  7. <span class="date"><img src="/images/commentlink.gif" alt="" /> <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_time() ?> on <?php comment_date('n/j/y') ?></a></span> <?php edit_comment_link('edit','&nbsp;&nbsp;',''); ?>
  8. </div>
  9. <?php if ($comment->comment_approved == '0') : ?>
  10. <em>Your comment is awaiting moderation.</em>
  11. <?php endif; ?>
  12. </li>
  13. <?php
  14. /* Changes every other comment to a different class */
  15. $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';?>
  16. <?php endforeach; /* end for each comment */ ?>
  17. </ol>

Un poco de estilo

CSS:
  1. ol.commentlist {
  2.     margin:0;
  3.     padding:0;
  4.     }
  5.  
  6. .commentlist li {
  7.     margin-bottom:8px;
  8.     background: #60360b url(http://www.yoursite.com/images/comment_arrows.gif) bottom no-repeat;
  9.     color:#FFF;
  10.     list-style:none;
  11.     width:413px;
  12.     }
  13.  
  14. .commentlist .commenttext {
  15.     background:url(http://www.yoursite.com/images/bg_paint.gif) no-repeat;
  16.     padding:22px 22px 50px 22px;
  17.     }
  18.  
  19. .commentlist cite {
  20.     display:block;
  21.     color:#FFF;
  22.     font-weight:bold;
  23.     text-transform:uppercase;
  24.     font-style:normal;
  25.     background:url(http://www.yoursite.com/images/bg_cite_arrows.gif) bottom repeat-x;
  26.     padding-bottom:12px;
  27.     font-size:1.1em;
  28.     }
  29.  
  30. .commentlist a:link, .commentlist a:visited {
  31.     color:#fff9b9;
  32.     }
  33.  
  34. .commentlist a:hover, .commentlist a:active {
  35.     color:#FFF;
  36.     }
  37.  
  38. .commentlist .date {
  39.     background:#930e27;
  40.     padding:3px;
  41.     }
  42.  
  43. li.alt {
  44.     background:#836241 url(http://www.yoursite.com/images/comment_arrows_alt.gif) bottom no-repeat;
  45.     }
  46.  
  47. li.alt .commenttext {
  48.     background:url(http://www.yoursite.com/images/bg_paint_alt.gif) no-repeat;
  49.     }   
  50.  
  51. li.alt .date {
  52.     background:#67421c;
  53.     padding:3px;
  54.     }

Descarga PSD original para este ejemplo - Ampliar info y mas ejemplos Styling Your Wordpress Comments

delicious, digg, barrapunto, meneame, digg , technorati , stumble it!
comentarios
  1. [...] blog serán muy especiales :P… Y bueno leyendo Xyberneticos pues encontré con este entrada Dar estilo a tus Comentarios Wordpress yo hace meses que queria saber como hacerlo pero no se me ocurria nada!!!… Y Si piensas [...]

  2. [...] Vía: Xyberneticos [...]

  3. Gerar2 - Gravatar

    Gerar2

    8 - 07 - 2008

    Permalink

    Master!
    Despues de tanto buscar y buscar, por fin encontré esta info!

    Gracias loko!

    Saludos desde Argentina

  4. Illi.Pro - Gravatar

    Illi.Pro

    8 - 07 - 2008

    Permalink

    Siempre en xyberneticos encuentro los mejores tips de diseño para mi blog, gracias Nikko ;)

  5. Marcelo - Gravatar

    Marcelo

    8 - 07 - 2008

    Permalink

    Se que aquí saben muchod e wordpress, alguin me podría decir porque tengo mi wordpress sin estilo. no me toma la hoja de estilo supongo... pero si alguin le ha pasado lo mismo o tiene alguna sugerencia se lo agaradeceria....

    Saludos

  6. [...] Dar estilo a tus Comentarios Wordpress. [Xyberneticos] [...]

  7. roy - Gravatar

    roy

    8 - 07 - 2008

    Permalink

    hi there, i would like to ask for some little help setting this up.
    I can't seem to make it work :(
    Can you please help me out with it?

    thanks,
    Roy

  8. [...] Dar estilo a tus Comentarios Wordpress [...]

  9. Diego-kun - Gravatar

    Diego-kun

    8 - 07 - 2008

    Permalink

    Todavia no comprendo esto...podrias hacer un tutorial mas detallado?



Nombre: (Necesario)

E-mail: (Necesario)

Website:

Escribe tu comentario: