• Hi all

    I try to develop a new theme from scratch – to make sure I understand every single bit of WordPress. ??

    I proceeded quite well so far; the only thing I have REALLY troubles with is the comment system: for some reason, the line containing the “Edit” and “x comments” underneath each article does not appear….

    I only have an index.php, header.php, sidebar.php footer.php, and functions.php in my theme (beside the css and the searchbar.php include); I created a comments.php, but this did not work. Here’s part of header.php:

    ...
    
        <?php //comments_popup_script(); // off by default ?>
        <?php wp_head(); ?>
      </head>
    
      <body>
        <div id="header">
          <h1><?php bloginfo('title') ?></h1>
          <ul>
            <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); /* list pages by menu-order but only first hierarchy */ ?>
            <li><?php include (TEMPLATEPATH . '/searchform.php'); ?></li>

    Here’s my index.php:

    <?php get_header(); ?>
    
    <?php get_sidebar(); ?>  
    
      <div id="content">
        <?php if (have_posts()) : ?>
    
          <?php while (have_posts()) : the_post(); ?>
    
            <div>
              <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
              <small>In <?php the_category(","); ?> on <?php the_date(); ?> </small>
              <?php the_content("More"); ?>
              <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
            </div> <!-- end of post-container -->
    
          <?php endwhile; ?>
    
        <?php else : /*no posts? */ ?>
    
          <h2>Not Found</h2>
          <p>Sorry, but you are looking for something that isn't here.</p>
          <!-- <?php include (TEMPLATEPATH . "/searchform.php"); ?> -->
    
        <?php endif; /* if post available */ ?>
      </div> <!-- end of "content" container -->
    
    <?php get_footer(); ?>

    When I look at the page containing an individual post, I see the header, the sidebar, the post itself – and directly underneath the footer; there is NO comment line…
    When I switch to another theme, everything works as designed…

    Sorry if this is a long post – but I really, really don’t know what I am doing wrong……. ??

Viewing 16 replies (of 16 total)
  • At least three (3) different things seem to be mixed in this thread:

    1. <?php //comments_popup_script(); // off by default ?> – this tells WP whether to use popup window for comments or “normal” comments below the single post view (as you can read in most themes it is OFF by default)

    2. The <?php comments_popup_link('Comments/Requests?', 'Comments? (1 so far)', 'Feedback! % Comments. Post yours', '', ''); ?> tag in a template – despite its misleading name! – will display the “comments link” showing how many comments there are for a post.

    3. <?php comments_template(); ?> will call (include) the comments.php template file. Obviously, it will work ONLY on single post view; that’s how the WP engine works.

    Leave #1 as it is in the head: commented out.
    #2 should be in the so-called multipost view template files = index, archive, category, search…
    #3 should be in the single.php template file (or in index, if your theme is lacking the single.php)

Viewing 16 replies (of 16 total)
  • The topic ‘I don’t understand the comment system’ is closed to new replies.