WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Leave a Reply to %s - Not Working (4 posts)

  1. Cassandri
    Member
    Posted 4 years ago #

    Hi, I've been upgrading our commenting system theme files to work with the new threaded comment options available in WordPress. I have pretty much replaced my entire comments.php file with the default theme code.

    Everything is working out lovely. I can reply to comments and create children (nested) comments. The respond form appears directly underneath the comment you are replying to.

    However, the code in my comments.php leads me to believe that if you are replying to an existing comment the title of the response form should change to Leave a Reply to *Previous Comment Author*. Mine always, always says "Leave a Reply" regardless if it is a child or parent comment.

    From comments.php

    <?php if ( comments_open() ) : ?>
    <div id="respond">
    <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
    <div class="cancel-comment-reply">
    	<small><?php cancel_comment_reply_link(); ?></small>
    </div>

    From header.php

    <link rel="pingback" href="<?php bloginfo('pingback_url') ?>" />
    <?php
    if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
    wp_head()
    ?>
    </head>

    Where else should I be checking my code? What other part of the theme might cause this dynamic header to fail or to always treat it as a new comment instead of a reply?

  2. Cassandri
    Member
    Posted 4 years ago #

    From comments.php (the entire Respond form)

    <div id="respond">
    
    <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>
    
    <div class="cancel-comment-reply">
    	<small><?php cancel_comment_reply_link(); ?></small>
    </div>
    
    <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
    <p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p>
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( is_user_logged_in() ) : ?>
    
    <p>Logged in as <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">Log out &raquo;</a></p>
    
    <?php else : ?>
    
    <p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
    
    <p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
    
    <p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
    <label for="url"><small>Website</small></label></p>
    
    <?php endif; ?>
    
    <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
    
    <p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p>
    
    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <?php comment_id_fields(); ?>
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <?php endif; // If registration required and not logged in ?>
    </div>
  3. Cassandri
    Member
    Posted 4 years ago #

    I think I found my answer.

    Reply to *Author* only works if the client doesn't have Javascript running, and therefore the Reply from doesn't pop up right under the parent comment - it's at the bottom of the page.

    Shame. I would have liked to dynamically change the heading title on all Reply To comments, regardless of Javascript status.

  4. joepahl
    Member
    Posted 3 years ago #

    Same issue. I could swear it worked at one time.

    It is possible that the js that moves the form is executing before the content of the reply title is changed. That's my theory at least.

    Hope it gets fixed.

Topic Closed

This topic has been closed to new replies.

About this Topic