-
AuthorPosts
-
July 31, 2018 at 6:32 pm #992040
I´d like to make some changes to the “comments” element namely by changing the text below with personalised text:
“Leave a Reply
Want to join the discussion?
Feel free to contribute!”as well as changing the position of the “name, email, website” words to the left of the input boxes as opposed to the right.
Any suggestions would be very much appreciated.
Many thanks
August 1, 2018 at 1:05 pm #992379Hey ProTravelGolf,
Thank you for using Enfold.
Those text are inside the theme’s “comments.php” file. You can modify that file directly or use the “Say What?” plugin.
// https://wordpress.org/plugins/say-what/
Best regards,
IsmaelAugust 1, 2018 at 1:56 pm #992405This reply has been marked as private.August 1, 2018 at 5:46 pm #992494Hi,
How would I do this via comments.php?August 2, 2018 at 5:51 am #992704Hi,
Thanks for the update.
You should see these codes in the comments.php file, around line 164.
echo " <div class='comment_container'>"; echo "<h3 class='miniheading'>".__('Leave a Reply','avia_framework')."</h3>"; echo "<span class='minitext'>".__('Want to join the discussion?','avia_framework')."".__('Feel free to contribute!','avia_framework')."</span>"; comment_form(); echo "</div>";
Just change the default text to something else and then saved the file. If it’s not working, post the login details in the private field so that we can test it. Make sure that the Appearance > Editor panel is accessible.
Best regards,
IsmaelAugust 2, 2018 at 4:18 pm #992921This reply has been marked as private.August 3, 2018 at 11:03 am #993175Hi,
1.) Yes, that’s correct. You can create a copy of that file and move it to the child theme folder to keep the changes in case of a theme update. :)
// https://developer.wordpress.org/themes/basics/template-files/
2.) You can use this filter to change the label and the markup of the comment form fields.
add_filter( 'comment_form_fields', 'avf_default_comment_fields', 10, 1); function avf_default_comment_fields($fields) { $fields = array( 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>', 'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req . ' /></p>', 'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' . '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>', ); return $fields; }
Best regards,
IsmaelAugust 3, 2018 at 11:42 am #993200This reply has been marked as private.August 3, 2018 at 12:41 pm #993227Hi,
You should put it in the functions.php file. Edit that file via Appearance > Editor panel or your file server. Adjust these parts:
__( 'Name' ) __( 'Email' ) __( 'Website' )
Best regards,
IsmaelAugust 3, 2018 at 1:20 pm #993243This reply has been marked as private.August 3, 2018 at 3:39 pm #993296Thanks Ishmael, this worked perfectly!
August 3, 2018 at 4:21 pm #993306This reply has been marked as private.August 6, 2018 at 6:08 am #993798Hi,
Thanks for the update.
I forgot to add the comment form’s field. Please try it again.
add_filter( 'comment_form_fields', 'avf_default_comment_fields', 10, 1); function avf_default_comment_fields($fields) { $fields = array( 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>', 'email' => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' . '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req . ' /></p>', 'url' => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' . '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>', 'comment' => '<p class="comment-form-comment"><label for="comment">' . __( 'Comment' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p>' ); return $fields; }
Best regards,
IsmaelAugust 6, 2018 at 6:42 pm #994032This reply has been marked as private.August 7, 2018 at 3:38 am #994188Hi,
1.) Use this css code to move the labels to the right of the input fields.
#commentform label { position: relative; margin-bottom: 5px; }
2.) Add this filter to change the default button text.
add_filter( 'comment_form_defaults', 'avf_comment_form_defaults_mod', 10, 1); function avf_comment_form_defaults_mod($args) { $args['label_submit'] = __( 'CHANGE THIS TEXT' ); return $args; }
Best regards,
IsmaelAugust 7, 2018 at 8:01 am #994258This reply has been marked as private.August 8, 2018 at 1:39 am #994646Hi,
That same css code works on my end. Can we take a look at the post with the comment form? Please provide a mock up or a screenshot of the end result so that we can see what you’re trying to achieve.
Best regards,
IsmaelAugust 8, 2018 at 2:13 am #994654This reply has been marked as private.August 8, 2018 at 4:14 am #994678Hi,
Thanks for the update.
This css code should override the default label styling.
#commentform label { position: relative !important; left: 0; float: left; margin-right: 10px; }
Best regards,
IsmaelAugust 8, 2018 at 6:38 am #994690This reply has been marked as private.August 8, 2018 at 11:11 am #994847Hi ProTravelGolf,
To make them more or less aligned vertically, they need to have the height of the longest comment, which is 833px. Then all the comment boxes will have a lot of whitespace and users will have to scroll a lot.
It looks ok now, reminds of a tiles layout.
Do you want to do that to try to make them the same height?
Best regards,
VictoriaAugust 8, 2018 at 4:48 pm #995061This reply has been marked as private.August 8, 2018 at 4:53 pm #995066This reply has been marked as private.August 9, 2018 at 8:22 am #995284Hi ProTravelGolf,
Yes, try adding this css code:
#commentform label { float: none; }
Hope it helps.
Best regards,
NikkoAugust 9, 2018 at 10:38 am #995357This reply has been marked as private.August 10, 2018 at 12:28 pm #995920This reply has been marked as private.August 10, 2018 at 1:29 pm #995944Hi ProTravelGolf,
I have checked your site and noticed that you don’t have the email field though it’s required by the form.
Can you try to uncheck Comment author must fill out name and email in Settings > Discussion.
Hope this helps.Best regards,
NikkoAugust 10, 2018 at 4:39 pm #996060This reply has been marked as private.August 12, 2018 at 12:41 pm #996439This reply has been marked as private.August 12, 2018 at 4:58 pm #996455Hi ProTravelGolf,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
#golfclub { max-width: 220px;}
As for the other 2 points, unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.