Vous n'êtes pas identifié.
Annonce
Annonce 1 : Le Codex en français a besoin de vous pour avancer !
Annonce 2 : Avant de poster, n'oubliez pas de faire une petite Recherche et de lire les règles de ce forum.
Annonce 3 : Lisez notre blog, il regorge de bonnes informations.
#1 03-07-2008 17:46:18
Afficher les commentaires dans une box.
Bonjour,
Je cherche à afficher les commentaires dans une box (Thickbox, si possible, que j'utilise par ailleurs).
Si qq'un a une idée...
Ma configuration WP actuelle
- Version de WordPress : 2.5.1
Hors ligne
#2 04-07-2008 11:34:13
Re: Afficher les commentaires dans une box.
En fouillant dans différents thèmes, j'ai trouvé ça:
single_comments.php
Code:
- <?php require('../../../wp-blog-header.php'); ?>
- <?php //get_header(); ?>
- <?php the_post();?>
- <?php
- //$templatedir = get_bloginfo('template_directory');
- $comments = $wpdb->get_results('SELECT * FROM '.$wpdb->comments.' WHERE comment_post_ID = \''.$post->ID.'\' AND comment_approved = \'1\' ORDER BY comment_date');
- if ($comments) :
- ?>
- <ol class="commentlist">
- <?php
- foreach ($comments as $comment) : ?>
- <?php $i++; /* For different background colors */
- ($i % 2 == 1) ? $bg_comment = 'class_comment1' : $bg_comment = 'class_comment2';
- ?>
- <li class="<?php echo $bg_comment; ?>" id="comment-<?php comment_ID() ?>">
- <?php echo get_avatar( $comment, 48, $default = 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress/wp-content/themes/photoblog/e030.gif' ); ?>
- <b><?php comment_author_link() ?></b> dit :
- <?php if ($comment->comment_approved == '0') : ?>
- <em>Votre commentaire est en attente de modération.</em>
- <?php endif; ?>
- <br />
- <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('j F Y') ?> à <?php comment_time() ?></a> <?php edit_comment_link('Editer','-- ',''); ?></small>
- <br /><br />
- <?php comment_text() ?>
- </li>
- <?php
- /* Changes every other comment to a different class */
- $oddcomment = ( empty( $oddcomment ) ) ? 'class="class_comment2" ' : '';
- endforeach; /* end for each comment */ ?>
- </ol>
- <!-- end of inline comments //-->
- <?php endif; ?>
- <?php //get_footer(); ?>
que j'appelle par
Code:
- ?php if ($post->comment_count > 0 ) { ?>
- (<a class="thickbox" title="Commentaire" href="<?php bloginfo(template_directory); ?>/single_comments.php?p=<?php the_ID(); ?>KeepThis=true&TB_iframe=true&height=600&width=400"><?php _e('Commentaire', 'clicclac'); ?></a>)
- <?php } ?>
Ca marche bien, sauf que je n'arrive pas à avoir ma feuille CSS du thème dans la thickbox.
Dernière modification par ClicClac (04-07-2008 11:36:07)
Hors ligne