ThemeShaper Forums » Thematic

[closed]

Is it possible to fully customize comment form?

(13 posts)
  • Started 4 years ago by vijayrajesh
  • Latest reply from AnotherAndrew
  • This topic is not resolved
  1. vijayrajesh
    Member

    Hi,

    I want to swap some fields. I mean i want to start the comment form field "message" first. Then i want to display name and email with submit button.

    This way i want to modify the position of fields. I think it is tough to do this with css. So, is there any way where i can call a php file with customized comment form in it.

    Thanks for the help,

    Posted 4 years ago #
  2. Danieliser
    Member

    you could use the thematic filters to modify it, that could get tricky if you want to do a lot of changes.

    This is probably the solution you need. Just add this to your functions.php and just change the second function to your form or use an include to a custom-comment.php

    function remove_comments(){
      remove_action('thematic_comments_template','thematic_include_comments',5);
    }
    add_action('init','remove_comments');
    function new_comment_form(){
      echo 'New Comment Form';
    }
    add_action('thematic_comments_template','new_comment_form',5);
    Posted 3 years ago #
  3. Thompson
    Member

    Would a php include be something like: '<?php include("custom-form.php"); ?>' and then create a custom-form.php in your child theme folder?

    Posted 3 years ago #
  4. Danieliser
    Member

    thats correct. to see that it does work just copy the code i pasted the first time. It should replace your comment form with "New Comment Form"

    just replace

    function new_comment_form(){
      echo 'New Comment Form';
    }
    add_action('thematic_comments_template','new_comment_form',5);

    with

    function new_comment_form(){
      include("custom-form.php");
    }
    add_action('thematic_comments_template','new_comment_form',5);
    Posted 3 years ago #
  5. AnotherAndrew
    Member

    Danieliser,

    Tried this and it doesn't work. The comment form does not appear.

    Seems simple enough though.

    Posted 3 years ago #
  6. AnotherAndrew
    Member

    Danieliser,

    Tried this and it doesn't work. The comment form does not appear.

    Seems simple enough though.

    Posted 3 years ago #
  7. never tried it, but you could define

    define('THEMATIC_COMPATIBLE_COMMENT_FORM', false);

    and then filter thematic_comment_form_args (which you can find in comments-extensions.php

    OR you could copy comments.php into you child theme and hack away there. due to template hierarchy WP will look in your child's folder first for comments.php (and every other template) and then go to the parent theme if it finds nothing

    Posted 3 years ago #
  8. AnotherAndrew
    Member

    helgatheviking,

    I tried to copy the comments.php into my template, but when I delete or move certain elements, nothing happens.

    However, if I delete everything out of there and throw in some generic html tags it responds.

    What gives?

    Posted 3 years ago #
  9. AnotherAndrew
    Member

    helgatheviking,

    Specifically I am trying to float the required fields to the right of the form labels.

    But I am not getting any response.

    Posted 3 years ago #
  10. having never tried this i don't know for sure. it is probably the conditionals and maybe you aren't editing the file in the right place?

    also to go that route i think you need to make sure that

    define('THEMATIC_COMPATIBLE_COMMENT_FORM', true);

    then you should be able to change the form layout around line 67

    Posted 3 years ago #
  11. AnotherAndrew
    Member

    Alright I discovered how to set the required fields for labels through CSS.

    If you need a solution let me know.

    Actually I will post this shortly. Hang with me....

    Posted 3 years ago #
  12. AnotherAndrew
    Member

    To float required field asterisks to the right of form labels:

    #respond form label {color: #666; font-weight: bold; letter-spacing: 0.3em; font-size: 9px; display: block; text-transform: uppercase; margin-left: 2px; margin-bottom: 0px; }
    #respond form input {font-family: Arial, Helvetica, sans-serif;display: block; border: 1px solid #ddd; padding: 2px; margin-bottom: 5px; border: 1px solid #c5c5c5; font-size: 12px; color: #333; background: #f0f0f0; width: 50%; clear:both;}
    #respond form input:focus {background: #fff; color: #aa300c;}
    #respond form textarea { font-family: Arial, Helvetica, sans-serif;font-size: 12px; padding: 2px; border: 1px solid #c5c5c5; color: #333; background: #f0f0f0;}
    #respond form textarea:focus {background: #fff; color: #aa300c;}
    #respond form label {float:left;}
    #respond form .required {}

    Posted 3 years ago #
  13. AnotherAndrew
    Member

    Helgatheviking is always right!

    To customize the form, you must have

    define('THEMATIC_COMPATIBLE_COMMENT_FORM', true);

    in your functions.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.