- This topic has 9 replies, 3 voices, and was last updated 1 year ago by
Leo.
-
AuthorPosts
-
April 12, 2020 at 2:35 am #1235987
Suraj Katwal
Hi, I am writing a tutorial on how to Remove URL Field From Comment form in GeneratePress. So, with different methods, I have included removing Website Field using a Child Theme.
What I have done until now is
1. Download the Child Theme
2. Upload > Activate
3. Make an inc > directory and import comments.php in Child Theme.Actually I want to remove Comment URL Field
$fields['url'] = sprintf( '<label for="url" class="screen-reader-text">%1$s</label><input placeholder="%1$s" id="url" name="url" type="url" value="%2$s" size="30" />', esc_html__( 'Website', 'generatepress' ), esc_attr( $commenter['comment_author_url'] ) );
Q. How to import comments.php to child Theme?
SEO, WordPress Optimization, Blogging Tutorials.
GeneratePress Tutorial: https://www.wplogout.comApril 12, 2020 at 9:40 am #1236385Leo
StaffCustomer SupportHi there,
We do have that documentation already:
https://docs.generatepress.com/article/remove-e-mail-and-url-field-from-comment-form/Q. How to import comments.php to child Theme?
Just copy the comments.php file from the parent theme:
https://github.com/tomusborne/generatepress/blob/master/comments.phpAnd paste into the child theme’s folder.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 12, 2020 at 6:17 pm #1236721Suraj Katwal
Hi LEO, I have already implemented the Code Snippet method but I want to remove URL Field using Child Theme Method.
$fields['url'] = sprintf( '<label for="url" class="screen-reader-text">%1$s</label><input placeholder="%1$s" id="url" name="url" type="url" value="%2$s" size="30" />', esc_html__( 'Website', 'generatepress' ), esc_attr( $commenter['comment_author_url'] ) );
Thanks
SEO, WordPress Optimization, Blogging Tutorials.
GeneratePress Tutorial: https://www.wplogout.comApril 13, 2020 at 4:07 am #1237070David
StaffCustomer SupportHi there,
the method Leo provided here works in a child theme too:
https://docs.generatepress.com/article/remove-e-mail-and-url-field-from-comment-form/Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 13, 2020 at 7:28 am #1237291Suraj Katwal
Hi David, I know about this method, also I know about CSS code to hide website input box and using a plugin we can do so. But I am writing a tutorial where I want to remove the below code from Inc > structure > comments.php folder.
$fields['url'] = sprintf( '<label for="url" class="screen-reader-text">%1$s</label><input placeholder="%1$s" id="url" name="url" type="url" value="%2$s" size="30" />', esc_html__( 'Website', 'generatepress' ), esc_attr( $commenter['comment_author_url'] ) );
So, this is for the tutorial purpose.
I am writing tutorial so I have listed 4 methods and among theme removing code directly is the 4th method and I removed the code in the comments.php by importing in child theme but it’s not working.Thank You.
SEO, WordPress Optimization, Blogging Tutorials.
GeneratePress Tutorial: https://www.wplogout.comApril 13, 2020 at 9:07 am #1237542Leo
StaffCustomer SupportWe are both not sure what you are trying to do unfortunately.
You will have to figure it out for your tutorial – it seems to be an overly complicated way to do it.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 14, 2020 at 8:49 am #1238871Suraj Katwal
Hi Again,
While removing the URL field code in GeneratePress Parent Theme, I was able to remove the Website URL field but after importing the same files with the same folder name is child Theme, it’s not working.To override the parent theme files, we have to import the same to the child theme and edit it, right?
Can you please help me with this, please.
Thank You.
SEO, WordPress Optimization, Blogging Tutorials.
GeneratePress Tutorial: https://www.wplogout.comApril 14, 2020 at 4:38 pm #1239301Leo
StaffCustomer SupportThe theme’s
comments.php
actually doesn’t control this.This filter is a WordPress filter and unrelated to the theme:
https://docs.generatepress.com/article/remove-e-mail-and-url-field-from-comment-form/The file you are looking for should be the
comment.php
file in the WordPress folder underwp-includes
.You will need to do some research on how to include/overwrite that in your child theme (it’s not a good idea generally when there is already a filter available).
Sorry but writing your tutorial isn’t something the theme support should help with. Perhaps try a site like this for general questions?
https://wordpress.stackexchange.com/Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 14, 2020 at 6:42 pm #1239371Suraj Katwal
Thank You
SEO, WordPress Optimization, Blogging Tutorials.
GeneratePress Tutorial: https://www.wplogout.comApril 14, 2020 at 7:10 pm #1239403Leo
StaffCustomer SupportNo problem 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.