Comment Box Issue with Genesis 1.9.1

Community Forums Forums General Discussion Comment Box Issue with Genesis 1.9.1

This topic is: not resolved

This topic contains 1 reply, has 1 voice, and was last updated by  devongroup 1 year, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12714

    devongroup
    Participant
    Post count: 18

    Hello ever since updating to the latest Genesis theme 1.9.1, I am having an issue with the blog comment box.

    Now the send button is just a blank box due to the html being different and lacking ID’s which my css hooked onto. Below is the previous html that was working, and below that is now how the html is (which again is lacking ID’s). ***Also I used validate.min.js and filtered the comments section to also add classes of required class=”required” which if this field is not filled it brings up an error message rather than going to a whole new window which just says: ERROR: please type a comment.

    I can send over screenshots to help but I do not see an attachment button.

    Old Working HTML:

    <div id=”respond”>
    <h3 id=”reply-title”>Speak Your Mind <small><a style=”display:none;” href=”/johnson-johnson-names-ceo-alex-gorsky-as-new-chariman-of-the-board/#respond” id=”cancel-comment-reply-link” rel=”nofollow”>Cancel reply</a></small></h3>
    <form id=”commentform” method=”post” action=”http://www.company.com/wp-comments-post.php” novalidate=”novalidate”>
    <p class=”logged-in-as”>Logged in as <a href=”http://www.company.com/wp-admin/profile.php”>Tim</a>. <a title=”Log out of this account” href=”http://www.company.com/wp-login.php?action=logout&amp;redirect_to=http%3A%2F%2Fwww.company.com%2Fjohnson-johnson-names-ceo-alex-gorsky-as-new-chariman-of-the-board%2F&amp;_wpnonce=d38b6e1a73″>Log out?</a></p>

    <p class=”comment-form-comment”><textarea aria-required=”true” tabindex=”4″ rows=”8″ cols=”45″ name=”comment” id=”comment” class=”required”></textarea></p><!– #form-section-comment .form-section –>                                                 <p class=”form-submit”>
    <input type=”submit” value=”Post Comment” id=”submit” name=”submit”>
    <input type=”hidden” id=”comment_post_ID” value=”1417″ name=”comment_post_ID”>
    <input type=”hidden” value=”0″ id=”comment_parent” name=”comment_parent”>
    </p>
    <input type=”hidden” value=”f0cbaa2532″ name=”_wp_unfiltered_html_comment” id=”_wp_unfiltered_html_comment_disabled”><script>(function(){if(window===window.parent){document.getElementById(‘_wp_unfiltered_html_comment_disabled’).name=’_wp_unfiltered_html_comment’;}})();</script>
    </form>
    </div>

    New Broken HTML:

    You can see the line <form id=”” method=”post” action=”http://www.company.com/wp-comments-post.php” > no longer has the ID of commentform and is missing “novalidate=”novalidate””

    No longer a logged in as/log out line: <p class=”logged-in-as”>Logged in as <a href=”http://www.company.com/wp-admin/profile.php”>Kevin</a>. <a title=”Log out of this account” href=”http://www.company.com/wp-login.php?action=logout&amp;redirect_to=http%3A%2F%2Fwww.company.com%2Fjohnson-johnson-names-ceo-alex-gorsky-as-new-chariman-of-the-board%2F&amp;_wpnonce=d38b6e1a73″>Log out?</a></p>

    The submit lines are missing id’s and values compared to my working previous html above:   <input type=”submit” value=”” id=”” name=”submit”>

    <div id=”respond”>
    <h3 id=”reply-title”>Speak Your Mind <small><a style=”display:none;” href=”/facebook-is-top-social-network-in-127-countries/#respond” id=”cancel-comment-reply-link” rel=”nofollow”>Click here to cancel reply.</a></small></h3>
    <form id=”” method=”post” action=”http://www.company.com/wp-comments-post.php”>
    <p class=”comment-form-comment”><textarea aria-required=”true” tabindex=”4″ rows=”8″ cols=”45″ name=”comment” id=”comment” class=”required”></textarea></p><!– #form-section-comment .form-section –>                                                <p class=”form-submit”>
    <input type=”submit” value=”” id=”” name=”submit”>
    <input type=”hidden” id=”comment_post_ID” value=”1461″ name=”comment_post_ID”>
    <input type=”hidden” value=”0″ id=”comment_parent” name=”comment_parent”>
    </p>
    <input type=”hidden” value=”0b97f82f33″ name=”_wp_unfiltered_html_comment” id=”_wp_unfiltered_html_comment_disabled”><script>(function(){if(window===window.parent){document.getElementById(‘_wp_unfiltered_html_comment_disabled’).name=’_wp_unfiltered_html_comment’;}})();</script>
    </form>
    </div>

    THE PHP:

    add_filter(‘genesis_comment_form_args’,’custom_email_note’); /* http://rickharrison.github.com/validate.js http://bassistance.de/jquery-plugins/jquery-plugin-validationhttp://docs.jquery.com/Plugins/Validationhttp://wpsmith.net/2011/genesis/how-to-customize-the-genesis-comment-form */
    function custom_email_note() {
    $args = array(
    ‘fields’ => array(
    ‘author’ =>  ‘<p class=”comment-form-author”>’ .
    ‘<input id=”author” class=”required” name=”author” type=”text” value=”‘ . esc_attr( $commenter['comment_author'] ) . ‘” size=”30″ tabindex=”1″‘ . $aria_req . ‘ />’ .
    ‘<label for=”author”>’ . __( ‘Name’, ‘genesis’ ) . ‘<span class=”frm_required”> *</span>’. ‘</label> ‘ .
    ( $req ? ‘<span class=”required”>*</span>’ : ” ) .
    ‘</p><!– #form-section-author .form-section –>’,

    ‘email’ =>   ‘<p class=”comment-form-email”>’ .
    ‘<input id=”email” class=”required email” name=”email” type=”text” value=”‘ . esc_attr(  $commenter['comment_author_email'] ) . ‘” size=”30″ tabindex=”2″‘ . $aria_req . ‘ />’ .
    ‘<label for=”email”>’ . __( ‘Email:’, ‘genesis’ ) . ‘<span class=”frm_required”> *</span>’ . ‘</label> ‘ .
    ( $req ? ‘<span class=”required”>*</span>’ : ” ) .
    ‘</p><!– #form-section-email .form-section –>’,

    ‘url’ => ‘<p class=”comment-form-url”>’ .
    ‘<input id=”url” name=”url” type=”text” value=”‘ . esc_attr( $commenter['comment_author_url'] ) . ‘” size=”30″  tabindex=”3″ />’ .
    ‘<label for=”url”>’ . __( ‘Website’, ‘genesis’ ) . ‘</label>’ .
    ‘</p><!– #form-section-url .form-section –>’
    ),

    ‘comment_field’ =>   ‘<p class=”comment-form-comment”>’ .
    ‘<textarea class=”required” id=”comment” name=”comment” cols=”45″ rows=”8″ tabindex=”4″ aria-required=”true”></textarea>’ .
    //’<label for=”comment”>’ . __( ‘Comments’ . ‘<span class=”frm_required”> *</span>’, ‘genesis’ ) . ‘</label>’  .
    ‘</p><!– #form-section-comment .form-section –>’,

    ‘title_reply’ => __( ‘Speak Your Mind’, ‘genesis’ ),

    ‘comment_notes_before’ => ”,

    ‘comment_notes_after’ => ”,
    );
    return $args;
    }

    #14059

    devongroup
    Participant
    Post count: 18

    Sorry All I know that is a lengthy forum post and I will open a pastebin in the future. At our company we worked out a filter for the comment form that works with WordPress 3.5 and Genesis 1.9.1

    After some research it seems that filtering the comment args and not comment fields is the preferred approach.

    * Please if anyone sees any downside to the below code please respond with feedback. Also I want to be able to tab from name fields to the submit button but currently it just tabs to the top of the page after the website field. If there is a way to filter the submit button code so I can add a tab index using the code below please let me know!

    Working Code:

    /** Edit comments form text **/
    function modified_comment_form_args($args) {
    $args['title_reply'] = ‘Leave a Comment / Join in the Discussion’;
    $args['comment_notes_before'] = ‘ <p class=”comment-policy”>All comments are moderated and will be displayed upon approval</p>’;

    $args['fields']['author'] =  ‘<p class=”comment-form-author”>’ .
    ‘<input id=”author” class=”required” name=”author” type=”text” value=”‘ . esc_attr( $commenter['comment_author'] ) . ‘” size=”30″ tabindex=”1″‘ . $aria_req . ‘ />’ .
    ‘<label for=”author”>’ . __( ‘Name’, ‘genesis’ ) . ‘<span class=”frm_required”> *</span>’. ‘</label> ‘ .
    ( $req ? ‘<span class=”required”>*</span>’ : ” ) .
    ‘</p><!– #form-section-author .form-section –>’;

    $args['fields']['email'] =  ‘<p class=”comment-form-email”>’ .
    ‘<input id=”email” class=”required email” name=”email” type=”text” value=”‘ . esc_attr(  $commenter['comment_author_email'] ) . ‘” size=”30″ tabindex=”2″‘ . $aria_req . ‘ />’ .
    ‘<label for=”email”>’ . __( ‘Email:’, ‘genesis’ ) . ‘<span class=”frm_required”> *</span>’ . ‘</label> ‘ .
    ( $req ? ‘<span class=”required”>*</span>’ : ” ) .
    ‘</p><!– #form-section-email .form-section –>’;

    $args['comment_field'] = ‘<p class=”comment-form-comment”>’ .
    ‘<textarea class=”required” id=”comment” name=”comment” cols=”45″ rows=”8″ tabindex=”4″ aria-required=”true”></textarea>’ .
    ‘<label for=”comment”>’ . __( ‘Comments’ . ‘<span class=”frm_required”> *</span>’, ‘genesis’ ) . ‘</label>’ .
    ‘</p><!– #form-section-comment .form-section –>’;
    return $args;
    }
    add_filter(‘genesis_comment_form_args’, ‘modified_comment_form_args’);

     

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.