Support » Fixing WordPress » Making Comments Behave in WordPress PHP Loop

  • I started WP last week and still read the WP Codex to make it work for me. Have prior knowledge in php and html. I try to use WP functions outside any of the templates.

    I succeeded with displaying POSTS, but failed to make COMMENTS work. How can I can use the WP comment php functions to show all comments without the popup to the default template? Where I can find a detailed description of the comments_popup_linkand comments_template function?

    Code which is in my own website below (outside the WP templates). Any input or hint appreciated.

    <!-- Load WP Functions -->
    <? include ('./blog/wp-blog-header.php'); ?> 	 
    <!--Begin WordPress Loop-->
    <?php if (have_posts()) :  while (have_posts()) : the_post(); ?>
    <!-- Show Blog Post Title-->
    <h1 class="storytitle"><?php the_title(); ?></h1>
    <!-- Show each post content & date -->
    <?php the_content(__('(more...)'));
    <?php the_date('',' (',')'); ?> 
    <!-- here the problem with showing comments-->
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    <?php comments_template(); ?>	
    <!--End WordPress Loop  -->
    <?php endwhile; endif; ?>

  • The topic ‘Making Comments Behave in WordPress PHP Loop’ is closed to new replies.