- This topic has 16 replies, 2 voices, and was last updated 1 year, 2 months ago by
Fernando.
-
AuthorPosts
-
July 28, 2022 at 7:42 pm #2296784
Jusung
Hello. I am trying to modify the comment section.
your team is saying use “generate_post_comment” this kind of code.
Where I am supposed to add this code?
Do I need to make the child theme and add this to php file?Is there any way to customize by using additional CSS?
July 28, 2022 at 7:59 pm #2296791Jusung
As you can see in the link,
I want to change the comment titile
1 thought on ~~
to CommentCan I modify this by adding CSS code?
July 28, 2022 at 8:19 pm #2296803Fernando Customer Support
Hi Jusung,
How exactly do you want the comment title to appear?
This is the filter you’ll need for the comment title:
generate_comments_title_output
Here’s a reference to adding PHP snippets: https://docs.generatepress.com/article/adding-php/#code-snippets
July 28, 2022 at 8:30 pm #2296808Jusung
Is there a way to modify it just by adding CSS code?
I want to change the title of “1 thought ~~~~” to Comment.On the link, go to the comment part by scrolling down.
July 28, 2022 at 10:09 pm #2296838Fernando Customer Support
Try this PHP:
add_filter('generate_comments_title_output', function( $output, $comments_title, $comments_number ){ $my_text = 'Comment'; return sprintf( '<h3 class="comments-title">%s</h3>', esc_html( $my_text ) ); }, 10, 3 );
Replace
Comment
with your preferred text.Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets
July 28, 2022 at 11:30 pm #2296902Jusung
Isn’t there any way to change the title by adding CSS code?
I just want to modify the comment section and don’t want to download a plug-in.
July 28, 2022 at 11:36 pm #2296904Fernando Customer Support
I see. You can try adding this in Additional CSS:
.comments-title { display:none; } div#comments:before { content:"Comment"; font-size: 40px; }
July 28, 2022 at 11:50 pm #2296914Jusung
Hello.
Thank you!It has been resolved now.
I have a last request.
The height of box is too high. So, when there are too many comments, it would be hard to read.
So, I want to reduce the height of comment section.Can you just give me the css code to reduce the size?
Maybe it could be done by modifying the padding.
The both part (comment and name)So, I can adjust it.
Thank you!
July 29, 2022 at 12:03 am #2296921Fernando Customer Support
You mean do comment content?
You can try this if so:
.comment-content { padding-top: 10px; padding-bottom: 10px; }
July 29, 2022 at 12:16 am #2296929Jusung
Yes it wokrs.
But I also want to reduce the name part.
It only reduces the comment part.July 29, 2022 at 12:34 am #2296939Fernando Customer Support
What part exactly? This?: https://share.getcloudapp.com/NQulXwZ8
If so, it has no spacing of its own, or are you referring to something else?
July 29, 2022 at 12:46 am #2296951Jusung
I want to remove the space on every box on the comment section.
What I have added is.comment-content {
padding-top: 10px;
padding-bottom: 10px;
margin-top:10px;}
.comment-body {
padding-top:10px;
}But still there is a space on the bottom part.
July 29, 2022 at 12:49 am #2296955Fernando Customer Support
Try this:
.comment-content { padding-top: 10px; padding-bottom: 10px; margin-top:10px; } .comment-body { padding-top:10px; } .comment-content p { margin-bottom: 0; }
July 29, 2022 at 12:49 am #2296956Jusung
.comment-content {
padding-top: 10px;
padding-bottom: 10px;
margin-top:10px;}
.comment-body {
padding-top: 40px;
padding-bottom:0;
}
After this code, it seems that there is no space now.
However, the length between comment and reply button is pretty far.Is there any code to reduce it?
July 29, 2022 at 12:52 am #2296959Jusung
.comment-content {
padding-top: 10px;
padding-bottom: 10px;
margin-top:10px;}
.comment-body {
padding-top:40px;
padding-bottom:0;
}.comment-content p {
margin-bottom:0;
}This is the last code and all size is good.
However, the line has got into the inside box.. -
AuthorPosts
- You must be logged in to reply to this topic.