143 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • United States
cramdesign says

I am working on a theme design and I just can’t get the comment form how I want with a CSS only solution… well, without absolute positioning and that seems dangerous because fonts and such could change. Anyway, if I could just wrap a few of the elements with a div or something I would be good but I cannot find how to insert my own html with comment_form(). Any help is appreciated…

2566 posts Put a Donk On It
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • United Kingdom
  • Exclusive Author
  • Attended a Community Meetup
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 200 and 499 users
+5 more
ThemeProvince says

comment_form() is actually just an output of the form you see in the comments section of a WordPress theme.

Send a message through my profile and I could send you a snippet.

143 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • United States
cramdesign says

Thanks ThemeProvince… message sent.

From the themes I have purchased here, I can see that most folks don’t use comment_form() and just put in their own code. This is fine but the theme checker plugin suggests that the correct way is to use comment_form()... just saying… does anyone know the correct way to do this? Maybe by redefining the function output somehow? Thanks…

3192 posts
  • Sold between 5 000 and 10 000 dollars
  • United States
  • Bought between 10 and 49 items
  • Has been a member for 4-5 years
  • Exclusive Author
organicbee says
cramdesign said
Thanks ThemeProvince… message sent. From the themes I have purchased here, I can see that most folks don’t use comment_form() and just put in their own code. This is fine but the theme checker plugin suggests that the correct way is to use comment_form()... just saying… does anyone know the correct way to do this? Maybe by redefining the function output somehow? Thanks…

 add_filter('comment_form_defaults', 'rapid_comment_form');

function rapid_comment_form($form_options)
{

    // Fields Array
    $fields = array(

        'author' =>
        '<p class="comment-form-author">' .
        ( $req ? '<span class="required">*</span>' : '' ) .
        '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' placeholder="' . __( 'Name' ) . '" />' .
        '</p>',

        'email' =>
        '<p class="comment-form-email">' .
        ( $req ? '<span class="required">*</span>' : '' ) .
        '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' placeholder="' . __( 'Email' ) . '" />' .
        '</p>',

        'url' =>
        '<p class="comment-form-url">'  .
        '<input name="url" size="30" id="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" type="text" placeholder="' . __( 'Website' ) . '" />' .
        '</p>',

    );

    // Form Options Array
    $form_options = array(
        // Include Fields Array
        'fields' => apply_filters( 'comment_form_default_fields', $fields ),

        // Template Options
        'comment_field' =>
        '<p class="comment-form-comment">' .
        '<textarea name="comment" id="comment" aria-required="true" rows="8" cols="45" placeholder="' . _x( 'Comment', 'noun' ) . '"></textarea>' .
        '</p>',

        'must_log_in' =>
        '<p class="must-log-in">' .
        sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
            wp_login_url( apply_filters( 'the_permalink', get_permalink($post_id) ) ) ) .
        '</p>',

        'logged_in_as' =>
        '<p class="logged-in-as">' .
        sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ),
            admin_url('profile.php'), $user_identity, wp_logout_url( apply_filters('the_permalink', get_permalink($post_id)) ) ) .
        '</p>',

        'comment_notes_before' =>
        '<p class="comment-notes">' .
        __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) .
        '</p>',

        'comment_notes_after' => '',

        // Rest of Options
        'id_form' => 'form-comment',
        'id_submit' => 'submit',
        'title_reply' => __( 'Leave a Comment' ),
        'title_reply_to' => __( 'Leave a Reply to %s' ),
        'cancel_reply_link' => __( 'Cancel reply' ),
        'label_submit' => __( 'Post Comment' ),
    );

    return $form_options;
}

the comment notes after is blank, its normally where they put the “allowed” html stuff or any thing you want after generally some text comments

143 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • United States
cramdesign says

@OrganicBeeMedia you rock! That’s gonna work for me. Thanks…

by
by
by
by
by
by