Tagged: x
-
AuthorPosts
-
March 3, 2017 at 10:54 am #1393495
EricParticipantHey I’m in the process of trying to remove the input field that allows users to enter their website and I found some codes that when added to the functions.php file were supposed to remove it, however for some reason it isn’t working for me.
I saw in one thread you guys recommended adding this:
function ra_remove_comment_url_field( $field ) {
return ”;
}
add_filter( ‘comment_form_field_url’, ‘ra_remove_comment_url_field’ );And in another thread I saw that they had recommended this:
add_filter(‘comment_form_default_fields’, ‘remove_url’);
function remove_url($fields)
{
if(isset($fields[‘url’]))
unset($fields[‘url’]);
return $fields;
}However after trying both nothing seems to change. Do you have any idea as to why these codes wouldn’t be working? And if they don’t work, would you have any other suggestion on how I could go about removing it?
As always thanks for all your great help.
March 3, 2017 at 10:55 am #1393496
EricParticipantThis reply has been marked as private.March 3, 2017 at 11:41 am #1393570
EricParticipantThis reply has been marked as private.March 3, 2017 at 9:55 pm #1394064
Rue NelModeratorHello There,
Thank you for the clarifications! Since you are using Ethos, to modify your comments section, please do the following:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file<?php // ============================================================================= // VIEWS/ETHOS/WP-COMMENTS.PHP // ----------------------------------------------------------------------------- // The area of the page that contains both current comments and the comment // form. The actual display of comments is handled by a callback to // x_comment(). // ============================================================================= $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $asterisk = ( $req ? '*' : '' ); $asterisk_html = ( $req ? '<span class="required">*</span>' : '' ); $aria_req = ( $req ? " aria-required='true' required='required'" : '' ); ?> <?php // // 1. If the current post is protected by a password and the visitor has not // yet entered the password, we will return early without loading the // comments. // if ( post_password_required() ) return; // 1 ?> <div id="comments" class="x-comments-area"> <?php if ( have_comments() ) : ?> <h2 class="h-comments-title"><span><?php _e( 'Comments' , '__x__' ); ?></span></h2> <ol class="x-comments-list"> <?php wp_list_comments( array( 'callback' => 'x_ethos_comment', 'style' => 'ol' ) ); ?> </ol> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> <nav id="comment-nav-below" class="navigation" role="navigation"> <h1 class="visually-hidden"><?php _e( 'Comment navigation', '__x__' ); ?></h1> <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', '__x__' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', '__x__' ) ); ?></div> </nav> <?php endif; ?> <?php if ( ! comments_open() && get_comments_number() ) : ?> <p class="nocomments"><?php _e( 'Comments are closed.' , '__x__' ); ?></p> <?php endif; ?> <?php endif; ?> <?php comment_form( array( 'comment_notes_before' => '', 'comment_notes_after' => '', 'id_submit' => 'entry-comment-submit', 'label_submit' => __( 'Submit' , '__x__' ), 'title_reply' => __( '<span>Leave a Comment</span>' , '__x__' ), 'fields' => array( 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', '__x__' ) . ' ' . $asterisk_html . '</label> ' . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" placeholder="' . __( 'Your Name', '__x__' ) . ' ' . $asterisk . '" size="30"' . $aria_req . ' />' . '</p>', 'email' => '<p class="comment-form-email">' . '<label for="email">' . __( 'Email', '__x__' ) . ' ' . $asterisk_html . '</label> ' . '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" placeholder="' . __( 'Your Email', '__x__' ) . ' ' . $asterisk . '" size="30"' . $aria_req . ' />' . '</p>', 'url' => '<p class="comment-form-url">' . '<label for="url">' . __( 'Website', '__x__' ) . '</label>' . '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" placeholder="' . __( 'Your Website', '__x__' ) . '" size="30" />' . '</p>' ), 'comment_field' => '<p class="comment-form-comment">' . '<label for="comment">' . _x( 'Comment', 'noun', '__x__' ) . '</label>' . '<textarea id="comment" name="comment" cols="45" rows="8" placeholder="' . _x( 'Your Comment *', 'noun', '__x__' ) . '"' . $aria_req . '></textarea>' . '</p>' ) ); ?> </div>Please do not forget to make your necessary changes in the code above.
3] Save the file named as
wp-comments.php
4] Upload this file to your server in the child theme’s folder
wp-content/themes/x-child/framework/views/ethos/Please let us know if this works out for you.
March 4, 2017 at 12:56 am #1394164
EricParticipantHey sorry but when you say ‘please do not forget to make your necessary changes’, what exactly should I be changing to achieve the desired outcome. I know how to access my FTP using filezilla but that aside I’m not too sure what to do.
Any additional guidance would be greatly appreciated.
Thanks!
March 4, 2017 at 3:54 am #1394267
ThaiModeratorHi There,
Please follow those steps with the following code:
<?php // ============================================================================= // VIEWS/ETHOS/WP-COMMENTS.PHP // ----------------------------------------------------------------------------- // The area of the page that contains both current comments and the comment // form. The actual display of comments is handled by a callback to // x_comment(). // ============================================================================= $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $asterisk = ( $req ? '*' : '' ); $asterisk_html = ( $req ? '<span class="required">*</span>' : '' ); $aria_req = ( $req ? " aria-required='true' required='required'" : '' ); ?> <?php // // 1. If the current post is protected by a password and the visitor has not // yet entered the password, we will return early without loading the // comments. // if ( post_password_required() ) return; // 1 ?> <div id="comments" class="x-comments-area"> <?php if ( have_comments() ) : ?> <h2 class="h-comments-title"><span><?php _e( 'Comments' , '__x__' ); ?></span></h2> <ol class="x-comments-list"> <?php wp_list_comments( array( 'callback' => 'x_ethos_comment', 'style' => 'ol' ) ); ?> </ol> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> <nav id="comment-nav-below" class="navigation" role="navigation"> <h1 class="visually-hidden"><?php _e( 'Comment navigation', '__x__' ); ?></h1> <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', '__x__' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', '__x__' ) ); ?></div> </nav> <?php endif; ?> <?php if ( ! comments_open() && get_comments_number() ) : ?> <p class="nocomments"><?php _e( 'Comments are closed.' , '__x__' ); ?></p> <?php endif; ?> <?php endif; ?> <?php comment_form( array( 'comment_notes_before' => '', 'comment_notes_after' => '', 'id_submit' => 'entry-comment-submit', 'label_submit' => __( 'Submit' , '__x__' ), 'title_reply' => __( '<span>Leave a Comment</span>' , '__x__' ), 'fields' => array( 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', '__x__' ) . ' ' . $asterisk_html . '</label> ' . '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" placeholder="' . __( 'Your Name', '__x__' ) . ' ' . $asterisk . '" size="30"' . $aria_req . ' />' . '</p>', 'email' => '<p class="comment-form-email">' . '<label for="email">' . __( 'Email', '__x__' ) . ' ' . $asterisk_html . '</label> ' . '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" placeholder="' . __( 'Your Email', '__x__' ) . ' ' . $asterisk . '" size="30"' . $aria_req . ' />' . '</p>', 'url' => '' ), 'comment_field' => '<p class="comment-form-comment">' . '<label for="comment">' . _x( 'Comment', 'noun', '__x__' ) . '</label>' . '<textarea id="comment" name="comment" cols="45" rows="8" placeholder="' . _x( 'Your Comment *', 'noun', '__x__' ) . '"' . $aria_req . '></textarea>' . '</p>' ) ); ?> </div>Hope it helps 🙂
March 4, 2017 at 10:20 am #1394456
EricParticipantHey I added that and it worked perfectly with regards to removing the URL field, however it didn’t the text below the leave a comment section that says ‘Your email address will not be published. Required fields are marked *’ (see above screenshot as reference).
Can this code be modified to include that?
Let me know and thanks for your help!
March 5, 2017 at 12:39 am #1394816
Rue NelModeratorHello There,
Thanks for updating in! You can edit these lines:
'comment_notes_before' => '', 'comment_notes_after' => '',please try adding something like this:
'comment_notes_before' => 'Add some text', 'comment_notes_after' => 'And another text',If nothing else works, would you mind providing us the ftp login credentials so we can take a closer look? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your credentials, we will be happy to assist you with everything.
To do this, you can make a post with the following info:
– FTP Hostname
– FTP Username
– FTP PasswordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thank you.
March 5, 2017 at 12:50 am #1394820
ChristopherModeratorHi there,
Please add following code in Customize -> Custom -> Global CSS :
p.comment-notes { display: none; }Hope that helps.
March 5, 2017 at 11:07 am #1395190
EricParticipantHey thanks for the reply. I changed the code within my FTP, adding text to the ‘comment_notes_before’ section, and it worked great. The last thing I want to do is customize that text, so is there some CSS that I could add for the ‘comment_notes_before’ section? I’m just trying to make the font a bit smaller and change the color to a dark grey.
Let me know! And thanks again.
March 5, 2017 at 11:20 am #1395201
ThaiModeratorHi There,
Please update the text to:
'comment_notes_before' => '<span class="custom-cmt-note">Your email address will not be published. Required fields are marked *</span>',After that add the following CSS:
.custom-cmt-note { color: #f0f0f0; font-size: 14px; }Hope it helps 🙂
March 5, 2017 at 11:39 am #1395220
EricParticipantHey that worked perfectly. Thanks a lot!
March 5, 2017 at 11:47 am #1395222
ThaiModeratorYou’re most welcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1393495 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
