• For reasons that are completely beyond me, our comments section is broken on our non-profit website.

    Here is a breakdown:

    1. Notice when you go here: https://www.coastalfootprint.org/post-3/
    The header for the comment section reads that there are two comments (and indeed there are supposed to be two that show up on that post) but nothing shows up, not even the comment form. Perplexing.

    2. Now, go here: https://www.coastalfootprint.org/test-2/. You will note that there is a comment form, but try and enter a comment and then all of the sudden the same problem crops up.

    Any ideas? The code for my comment form is below”

    <ul id="comment-start">
        <?php wp_list_comments('type=comment&callback=mytheme_comment'); ?>
    </ul>
    <br />
    
    <div id="respond" class="respond-style form-comment">
    
        <!--COMMNET FORM-->
    
        <div class="cancel-comment-reply">
            <small><?php cancel_comment_reply_link(); ?></small>
        </div> <!-- end cancel-comment-reply div -->
    <?php if ( comments_open() ) : ?>
        <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
        <p class="comment-p-style"><?php _e('You must be',THEME_NAME)?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"><?php _e('logged in',THEME_NAME) ?></a> <?php _e('to post a comment.',THEME_NAME) ?></p>
        <?php else : ?>
        <div class="form-holder">
            <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform contact-form" >
                    <?php if ( $user_ID ) : ?>
    
                <div class="comment-form-left margintop15" >
                    <p><?php  _e('Logged in as',THEME_NAME) ?> <a  href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account"><?php _e('Log out &raquo;',THEME_NAME) ?></a></p>
                </div>
                    <?php else : ?>
    
                <span class="title-border-content"><h2>Leave a comment</h2><div class="title-border"></div></span>
                <div class="form-input">
    
                    <div class="bg-input left" style="margin-top: 25px;">
                        <span><label for="author"><?php _e('Name and Surname:', tk_theme_name); ?></label></span>
                        <input type="text" spellcheck="false" name="author" id="contactname" value="" class="contact_input_text" tabindex="1" />
                    </div>
    
                     <div class="bg-input left"><span><label for="email"><?php _e('E-mail Address:', tk_theme_name); ?></label></span>
                        <input type="text" spellcheck="false" name="email" id="email" value="" class="contact_input_text" tabindex="2" />
                    </div>
    
                </div>
    
                    <?php endif; ?>
                                    <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
    
                <div class="form-textarea">
                  <div class="bg-input left"><span><?php _e('Message:', tk_theme_name); ?></span>
                        <textarea name="comment" spellcheck="false" id="message" class="input comment-textarea" tabindex="4"></textarea>
                    </div>
                </div>
    
                <div class="clear-both"></div>
    
                <div class="form-single-button">
                       <div class="red">
                            <div class="red-left"></div>
                            <div class="red-center"> <input type="submit" class="blog-send-button" name="submit-comment"  value="<?php _e('Send', tk_theme_name); ?>" /></div>
                            <div class="red-right"></div>
                        </div>
                 </div>
    
                <div class="clear-both"></div>
                    <?php comment_id_fields(); ?>
                    <?php do_action('comment_form', $post->ID);
                    ?>
            </form>
    
            <?php endif; ?>
    
            <div class="clear-both"></div>
        </div><!--form holder -->
        <?php endif; // If registration required and not logged in ?>
        <!-- This is jQuery for form fields -->
        <script type="text/javascript">
            jQuery(document).ready(function() {
    
                jQuery('input[type="text"]').last().css('margin','0');
                jQuery('input[type="text"]').addClass("idleField");
                jQuery('input[type="text"]').focus(function() {
                    jQuery(this).removeClass("idleField").addClass("focusField");
                    if (this.value == this.defaultValue){
                        this.value = '';
                    }
                    if(this.value != this.defaultValue){
                        this.select();
                    }
                });
                jQuery('input[type="text"]').blur(function() {
                    jQuery(this).removeClass("focusField").addClass("idleField");
                    if (jQuery.trim(this.value) == ''){
                        this.value = (this.defaultValue ? this.defaultValue : '');
                    }
                });
                jQuery('textarea').addClass("idleField");
                jQuery('textarea').focus(function() {
                    jQuery(this).removeClass("idleField").addClass("focusField");
                    if (this.value == this.defaultValue){
                        this.value = '';
                    }
                    if(this.value != this.defaultValue){
                        this.select();
                    }
                });
                jQuery('textarea').blur(function() {
                    jQuery(this).removeClass("focusField").addClass("idleField");
                    if (jQuery.trim(this.value) == ''){
                        this.value = (this.defaultValue ? this.defaultValue : '');
                    }
                });
            });
        </script>
        <!-- end of script -->
    </div> <!-- end respond div -->
    <br/><br/><br/>
  • The topic ‘Comment Section Broken’ is closed to new replies.