Comment Hook Problem

It appears that when I insert the hooks that are in the comment_form.php file associated with my theme it completely throws off the layout of the theme.

Here is a link. I’ve also attach an image.

  • DavidM
    • DEV MAN’s Mascot

    Hi creativ3group,

    I see what you mean. It seems to be sitting within the class ‘grid_8’ div. Any chance you could try adding it between the <article> tags?

    Also, are you sure your theme doesn’t provide more comment hooks? I’ve seen themes with quite a number of potential places to add things like this.



  • Tyler Orr
    • Site Builder, Child of Zeus

    Still having no luck.

    Here is the comment_form.php file. Maybe you can help in identifying the correct hooks. The form does’t show up unless I grab the top hook ‘wp_get_current_commenter’ but it completely crashes the layout when I do so.

    <?php if(!defined('BANDIT_INIT')) exit('No direct script access allowed'); ?>
    <?php use BanditFrameworkHelpersBanditHelper as bandit; ?>

    global $user_identity;
    $commenter = wp_get_current_commenter();

    <form class="bandit-form" action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="commentform">

    <header class="info">
    <h4><?php comment_form_title(bandit::get_lang('comments_form_title_add'),bandit::get_lang('comments_form_title_reply')); ?></h4>
    <?php cancel_comment_reply_link(bandit::get_lang('comments_form_cancel_reply')); ?>

    <?php if (is_user_logged_in()): ?>
    <div>Logged in as <a href="<?php echo admin_url('profile.php'); ?>"><?php echo $user_identity; ?></a></div>

    <?php else: ?>

    <li class="leftThird">
    <label for="author" class="desc"><?php bandit::lang('comments_form_name'); ?>
    <span class="req">*</span>
    <input type="text" name="author" value="<?php echo esc_attr($commenter['comment_author']); ?>" id="author" class="field text medium">

    <li class="middleThird">
    <label for="email" class="desc"><?php bandit::lang('comments_form_email'); ?>
    <span class="req">*</span>
    <input type="text" name="email" value="<?php echo esc_attr($commenter['comment_author_email']); ?>" id="email" class="field text medium">

    <li class="rightThird">
    <label for="url" class="desc"><?php bandit::lang('comments_form_website'); ?></label>
    <input type="text" name="url" value="<?php echo esc_attr($commenter['comment_author_url']); ?>" id="url" class="field text medium">
    <?php endif; ?>

    <label for="comment" class="desc"><?php bandit::lang('comments_form_comment'); ?></label>
    <textarea name="comment" id="comment" cols="50" rows="10" class="field textarea medium"></textarea>

    <li class="buttons">
    <input id="saveForm" name="saveForm" class="btTxt submit" type="submit" value="Submit" />

    <?php comment_id_fields(); ?>
    <?php do_action('comment_form', $post->ID); ?>

  • dunskii
    • Site Builder, Child of Zeus


    Don’t know if this will help, but I was having a similar issue not being able to find the right hooks so I ended up doing the following and seems to be working.

    I added <?php do_action(‘comment_form_start’, $post->ID); ?> directly above <form action ……


    <?php do_action(‘comment_form_end’, $post->ID); ?> directly above </form>

    And it seems to be working, I get notified of the comment and comments are posted to walls etc if selected.

    Though for some reason once the comment is submitted, the facebook tab is selected, but thats an issue for another day, seeing as its just past beer o’clock on friday :wink:

    Good luck


  • Philip John
    • DEV MAN’s Apprentice


    Just checking if it was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that’s great news.

    If not, could you let us know by re-opening this topic, and we’ll get onto it and helping you out asap!

    Otherwise, happy days, glad you got it sorted :slight_smile:



Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.