- This topic has 7 replies, 2 voices, and was last updated 5 years, 6 months ago by Tom.
-
AuthorPosts
-
October 2, 2018 at 7:40 am #691545dassana
there are some changes i want to make in the comment form:
1. in the comment title the text – “no of” thoughts on ‘recipe title’ comes on all posts. i just want to add “no of” comments and reviews instead of the long recipe title.
2. the comment form should appear above the comments and not below the comments.
3. the line ‘your email is not shared’ is not there. i want this line to be added.
4. i also want to write a short snippet on comment policy in the comment form itself after the recipe rating tab.
5. instead of ‘leave a comment’ is it possible to write something else like ‘leave a comment or review’ or ‘did you try this recipe’ or ‘review this recipe’ etc.
do let me know how to implement these changes.
for now i an using these css codes for the comment form:
.comments-area input#url {
display: none;
}.comment-form #author, .comment-form #email {
display: inline-block;
}.comment-form {
border: double #e5e5e5;
padding: 20px 20px 30px 20px;
}.comment-form #email {
float: right;
}October 2, 2018 at 5:39 pm #692006TomLead DeveloperLead DeveloperHi there,
1. I’m not too sure what you mean by this. Can you explain a bit more?
2. You’d have to download this file as
comments.php
and add it to your child theme: https://gist.github.com/generatepress/9a0f6cf705cd594ab22296c6a8e8de3f3. The function in #1 adds this.
4. Try this:
add_action( 'comment_form_after_fields', function() { ?> <p>Your message here.</p> <?php } );
5. Try this:
add_filter( 'generate_leave_comment', function() { return 'Review this recipe'; } );
October 3, 2018 at 7:29 am #692450dassanathanks tom. i did install child theme and made the comment changes. but the child theme breaks my site. so uninstalled it and reverted back to generatepress.
i added the codes you gave in the snippets plugin. worked well, but i need to make some css changes. you can check this url – https://www.vegrecipesofindia.com/eggless-butter-cake-recipe/#comments
the words “Review or Leave a comment. If you have made the recipe, then you can give a star rating too. All comments are moderated before they appear on the website. We thank you for waiting.” are all h4. i only want the review or leave a comment h4 and the rest of the words in normal text. also how to create space between the two lines like there are between paragraphs.
the number one point you did not understand is that the starting of comment section when there are comments being with eg -8 thoughts on “butter cake recipe – how to make soft butter cake without eggs”
i just want to show 8 comments or reviews. thats it.
is this possible without using the child theme as it breaks my site.October 3, 2018 at 4:51 pm #692909TomLead DeveloperLead DeveloperWhat about it broke your site? Any specific error messages?
I don’t believe a hook exists for right after your title for that message. You could try this maybe:
add_action( 'comment_form_top', function() { ?> Your long message after title. <?php } );
Right now it’s not very easy to change that title, but it will be easier in 2.2: https://generatepress.com/forums/topic/change-comment-text-and-create-anchor-link-to-leave-a-comment/#post-664590
October 4, 2018 at 6:19 am #693250dassanawill wait. i again enabled child theme today. the site errors were due to cache plugin. i have added these codes in the code snippets plugin. should i let them be there or add the above codes to the comments.php file.
October 4, 2018 at 9:22 am #693488TomLead DeveloperLead DeveloperThe standalone functions can go in Code Snippets or your child theme
functions.php
file.The
comments.php
file is separate from the functions.October 4, 2018 at 9:32 am #693499dassanathanks tom for the clarification.
October 4, 2018 at 4:35 pm #693767TomLead DeveloperLead DeveloperNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.