• Can you point me to the code that allows me to add the ability to comment following the content on my static page? There’s a lot of remarks on Forums that just don’t work. I badly need a proven solution.
    Thank you!
    Bob Batson

Viewing 8 replies - 1 through 8 (of 8 total)
  • It generally depends on the theme you are using, but I would be willing to bet your page.php template file lacks this

    <?php comments_template('',true); ?>

    That will load the comments template for the page. It belongs at the bottom of the loop.

    Thread Starter rgbatson

    (@rgbatson)

    Thank you Jackson. However, this is a static page. Do I put the loop after my static content?
    This is my first effort with WP, after studying two books and a load of doc. Very thin on adding comments to static page though.

    I assumed that you were talking about pages created in WordPress – are you?

    You need a post or page for the comments to belong to, so adding WordPress commenting to some static HTML file isn’t going to work easily.

    So if that’s the case, more details please…

    Thread Starter rgbatson

    (@rgbatson)

    Thank your for your kind attention. The static page code is from the single.php with a template heading added. Below the dashed line I have added the code inserted from the admin page where it allows that page to be edited. I don’t know where WP inserts that added code. The url for the page is: http://www.competencybasedmanagement.com/

    <?php
    /*
    Template Name: single page
    */
    ?>
    <?php
    /**
    * The Template for displaying all single posts.
    *
    * @package WordPress
    * @subpackage Twenty_Eleven
    * @since Twenty Eleven 1.0
    */

    get_header(); ?>

    <div id=”primary”>
    <div id=”content” role=”main”>

    <?php while ( have_posts() ) : the_post(); ?>

    <nav id=”nav-single”>
    <h3 class=”assistive-text”><?php _e( ‘Post navigation’, ‘twentyeleven’ ); ?></h3>
    <span class=”nav-previous”><?php previous_post_link( ‘%link’, __( ‘<span class=”meta-nav”>←</span> Previous’, ‘twentyeleven’ ) ); ?></span>
    <span class=”nav-next”><?php next_post_link( ‘%link’, __( ‘Next <span class=”meta-nav”>→</span>’, ‘twentyeleven’ ) ); ?></span>
    </nav><!– #nav-single –>

    <?php get_template_part( ‘content’, ‘single’ ); ?>

    <?php comments_template( ”, true ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>
    </div><!– #primary –>

    <?php get_footer(); ?>

    —————————————————————–
    codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0″><param name=”flashvars” value=”src=http%3A%2F%2Fwww.competencybasedmanagement.com%2Fwp-content%2Fuploads%2F2011%2F08%2FIntroduction-to-Workforce-Planning-Multi-Media-Presentation-B03-1.mp4&poster=http%3A%2F%2Fwww.competencybasedmanagement.com%2Fwp-content%2Fuploads%2F2011%2F08%2Fopening..jpg” /><param name=”allowFullScreen” value=”true” /><param name=”allowscriptaccess” value=”always” /><param name=”src” value=”http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf&#8221; /><param name=”allowfullscreen” value=”true” /><embed width=”600″ height=”450″ type=”application/x-shockwave-flash” src=”http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf&#8221; flashvars=”src=http%3A%2F%2Fwww.competencybasedmanagement.com%2Fwp-content%2Fuploads%2F2011%2F08%2FIntroduction-to-Workforce-Planning-Multi-Media-Presentation-B03-1.mp4&poster=http%3A%2F%2Fwww.competencybasedmanagement.com%2Fwp-content%2Fuploads%2F2011%2F08%2Fopening..jpg” allowFullScreen=”true” allowscriptaccess=”always” allowfullscreen=”true” /></object>

    <?php comments_template( ”, true ); ?>

    If you’re using the default theme, you didn’t need to add anything. You should just need to make sure that comments are enabled for the page. Looks like comments are working on your site already. To make sure comments are enabled for the page, go to Pages > All Pages – find your page, mouse over and click ‘Quick Edit’ – make sure the ‘Allow Comments’ checkbox is selected.

    Thread Starter rgbatson

    (@rgbatson)

    Yes, ‘allow comments’ is clicked, but no comment entry form appears.

    Switch to the default page template, and see if it appears. If it does the problem is with your custom page template.

    If you need someone to look at your code, paste it here : http://wordpress.pastebin.com then paste a link here.

    Thread Starter rgbatson

    (@rgbatson)

    Thank you. I was putting <?php comments_template(); ?> in the wrong place – in page edit section instead of template. Works now!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Add comments to static page’ is closed to new replies.