- This topic has 14 replies, 6 voices, and was last updated 1 year, 5 months ago by
David.
-
AuthorPosts
-
May 28, 2017 at 12:58 pm #325275
Phil
I am a noob, so this is probably a dumb question.
How can I add a comments form when I have a post set up using “sections”? I like formating with this feature, but the sidebar widgets and comments do not show up.Thanks,
PhilGeneratePress 1.3.46May 28, 2017 at 3:02 pm #325307Leo
StaffCustomer SupportHi Phil,
Unfortunately comments aren’t activated in Sections. See Tom’s explanation here: https://generatepress.com/forums/topic/showing-comments-with-sections-add-on/
You could activate sidebar though: https://docs.generatepress.com/article/allow-sidebars-sections/
Let me know if this helps.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 28, 2017 at 3:44 pm #325318Phil
Thank you, Leo! I hope that Tom can find a way to make this work in the future. This is a slight setback, nonetheless GP is an awesome theme.
May 28, 2017 at 3:45 pm #325319Leo
StaffCustomer SupportI’ll make sure he sees the request π
Glad you are enjoying GP!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/May 28, 2017 at 4:19 pm #325331Phil
Okay, so here is what I did to make it work….
I used the Code Snippets plugin to add a shortcode for the comments form, as described in this post on wpsites.net.
I then added the shortcode to a new section on the page. I’m not sure if it makes a difference, but I placed the shortcode in a div element. I mainly did this so that I can add CSS styles, if I want to.
Here is the finished product, if you want to see. https://ipninja.info/netmon/network-monitoring-solutions/
Thanks,
PhilMay 28, 2017 at 4:54 pm #325339Phil
One more thing…
Just using the “comments_form” function does not provide all of the functionality, so I used “comments_template” instead. Works great!
Thanks,
PhilMay 28, 2017 at 5:41 pm #325352Leo
StaffCustomer SupportAwesome job! Thanks for sharing! I’m sure other users will find it helpful π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 21, 2018 at 2:52 am #655377Alexander
Any update about this issue ?
August 21, 2018 at 8:51 am #655858Tom
Lead DeveloperLead DeveloperThis likely isn’t something that will be added to the plugin, but the solution Phil mentioned above is great π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 3, 2019 at 6:15 am #858091David
Would it be possible to get step by step instructions on how to implement Phil’s solution?
I have tried it but I am missing something.
What I did:
I added the following code to my functions.php file: (okay, I know that this is not the smartest and best way to do this)add_shortcode( 'dt_get_comments_template', 'dt_get_comments_template_shortcode' ); function dt_get_comments_template_shortcode() { ob_start(); comments_template(); $cform = ob_get_contents(); ob_end_clean(); return $cform; }
==========================
I have “quick edited” the page to “allow comments”.
I open up the page in the WP editor, I notice that the “allow comments” is ticked and add a new section to the bottom and add the following code to it:<?php echo dt_get_comments_template_shortcode(); ?>=========================
I tried a few different variations but no luck. For example, remove echo, remove () however no luck.Thanks,
DavidApril 3, 2019 at 8:56 am #858505Tom
Lead DeveloperLead DeveloperHey David,
With that function added, you can just add this shortcode to one of your Sections:
[dt_get_comments_template]
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 3, 2019 at 9:16 am #858533David
Hey Tom,
Thanks for that. It worked a treat.
Thanks,
DavidApril 3, 2019 at 4:22 pm #858843Tom
Lead DeveloperLead DeveloperYou’re welcome π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 8, 2019 at 6:53 pm #1057459Jeff
Hi All,
I’m pretty new to WordPress but I’m loving the GeneratePress theme and have been making some good progress with it. I’m still a newbie though so thanks in advance for your patience. π
Like others on this thread, I’m having problems with getting Comments to work on a Page that has Sections enabled.
Here’s what I did…
1. Installed the Code Snippets plug-in and added the following snippet.add_shortcode( ‘wpsites_comment_form’, ‘wpsites_comment_form_shortcode’ );
function wpsites_comment_form_shortcode() {
ob_start();
comment_form();
$cform = ob_get_contents();
ob_end_clean();
return $cform;
}2. On my page I created a new Section and added:
[wpsites_comment_form]This seemed to work and the Comments form shows up on the page with fields:
– comment field
– name
– email
– website
– checkbox for “Save my name, email and website in this browser for the next time I comment”The problem is, after submitting a couple test Comments and approving them on the back-end… they don’t appear to show up anywhere on the page? Any ideas why?
Second question… Is it possible to customize the comment form and say, change the field order or remove the website field? I’m sure the answer is yes… but HOW?
Thanks,
JeffEDIT:
Problem number one solved! I updated my snippet to use the one David provided above:
[dt_get_comments_template] and added that to my page instead and the comments are now showing!
Still wondering how to customize the form fields though.November 9, 2019 at 7:49 am #1057958David
Hi Jeff,
Thrilled to hear that you got the first thing sorted.
A couple of years ago I wrote a blog post on how to remove the website field from the comments form.
You can read that article below.
https://djtrlm.com/in-wordpress-how-to-remove-website-url-from-comments/
Hope this helps,
Cheers,
David -
AuthorPosts
- You must be logged in to reply to this topic.