Forums
Forums / Fixing WordPress / Wp_list_comments : invisible
(@netpom)
12 years, 6 months ago
Hi everyone,
I did my own theme, that you can see online here: http://www.regardsdumonde.fr.
I have a problem with the function wp_list_comments When I go to my article (example here) I can see the_content() and the_title() but when I try to see the comment it doesn’t work. I want to know why 🙁
This is the code of my page:
<?php $my_query = new WP_Query('p='.$article_num); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <article class="category-<?php echo $rub; ?>"> <div class="contenu"> <h2><?php the_title(); ?></h2> <?php the_content(); ?> </div> </article> <?php if ( comments_open() ) : ?> <article class="article medium" id="commentaires"> <div class="contenu"> <h3><?php printf( _nx( '1 commentaire', '%1$s commentaires', get_comments_number(), 'comments title', 'twentythirteen' ),number_format_i18n( get_comments_number() ) ); ?> </h3> <ol class="comment-list"> <?php //wp_list_comments('type=comment&callback=mytheme_comment'); ?> <?php //mytheme_comment('type=comment'); ?> <?php //comments_template(); ?> <?php wp_list_comments(); ?> <?php //wp_list_comments('callback=mytheme_comment'); ?> </ol> </div> </article> <?php endif; // end have_comments() ?> <?php endwhile; ?>
I tried all this lines, one by one, but it doesn’t show anything.
(@alchymyth)
wp_list_comments() is usually called from within the comments_template() function, and needs some preparation;
wp_list_comments()
comments_template()
for instance review: http://codex.ww.wp.xz.cn/Function_Reference/wp_list_comments#Display_Comments_for_a_Specific_Page.2FPost
The topic ‘Wp_list_comments : invisible’ is closed to new replies.
(@netpom)
12 years, 6 months ago
Hi everyone,
I did my own theme, that you can see online here: http://www.regardsdumonde.fr.
I have a problem with the function wp_list_comments
When I go to my article (example here)
I can see the_content() and the_title() but when I try to see the comment it doesn’t work. I want to know why 🙁
This is the code of my page:
I tried all this lines, one by one, but it doesn’t show anything.