Community Forums › Forums › Archived Forums › Design Tips and Tricks › Subscribe to comments
Tagged: subscribe to comments
- This topic has 11 replies, 3 voices, and was last updated 9 years ago by
unklee.
-
AuthorPosts
-
April 6, 2016 at 5:18 am #183037April 6, 2016 at 6:11 am #183041April 6, 2016 at 6:20 am #183042
unklee
MemberHi Carasmo, thanks for replying. Do you recommend that plugin, or have you used it? it seemed to me to try to do too much, and when I trialled it, it said something about amending my database (can't remember the exact words) and that scared me a little.
April 6, 2016 at 8:26 am #183055carasmo
ParticipantI don't use it. It addresses the issues of the other plugin. If you read all the faqs and other information, it won't affect core tables. To be safe, I don't install unsure plugins on a live site unless I'm prepared to roll back. I tend to export my database in phpMyAdmin and then set up a dev server on my computer with the same everything, except for the images, then I test.
However to answer your OP, here is what you add to your functions.php file VIA FTP and with a code editor OUTSIDE all other functions and brackets. Change the yourprefix_ to yours.
/** * * Show Manual Subscription Form * https://codex.wordpress.org/Function_Reference/comment_form * */ function yourprefix_show_manual_sub_form() { if( function_exists('show_manual_subscription_form') ) show_manual_subscription_form(); } add_action( 'comment_form_after', 'yourprefix_show_manual_sub_form' );
April 12, 2016 at 6:48 am #183433unklee
MemberHi Carasmo,
I'm sorry to take so long to reply. I felt sure I wrote a reply a few days ago, but it's not here - I must have stuffed something up.
I'm afraid I'm just not up to working this out, I'm sorry. I know enough WP and PHP to follow other people's code (generally) and to make minor modifications (e.g. I have added heaps of things to my functions.php file) but this is beyond me. Would you mind giving me a bit more advice please?
1. I presume this code is meant to work in conjunction with the Subscribe to comments plugin?
2. Is there other code I need as well as this?
3. What do you mean by "yourprefix"?Thanks.
April 18, 2016 at 5:18 pm #183870unklee
MemberI am still trying to get Subscribe to Comments to work. On my trial site I tried deactivating all other plugins and that didn't work. Then I tried changing theme from Genesis/Minimum Pro to the standard WP Twenty Sixteen, and that did the trick.
So it seems that Genesis or Minimum Pro has done something to stop Subscribe to Comments working. Does anyone know anything about this please? If I understood Carasmo's solution (above) would it work?
Any help for a struggling user would be appreciated. Thanks.
April 19, 2016 at 10:51 am #183942Christoph
MemberHi,
1) Carasmo's snippet inserts the code you mentioned in your first post.
So yes, it will only work with the subscribe to post plugin.2)
No.3)
The prefix in front of the function name:
'yourprefix_show_manual_sub_form'You should change it to something else. E.g.
'unklee_show_manual_sub_form'Yes, the code works.
First, it makes sure that subscribe to connect is activated and then adds the manual subscription form underneath the comment form.
April 20, 2016 at 12:03 am #183970unklee
MemberHi Christoff, thanks so much for your help. Unfortunately, I haven't been able to get it to work, even after deactivating all the plugin, even after switching to another theme (Twenty Sixteen).
There was another person who had problems with this, and later I checked and it was working on her site. I wrote to ask what she did and the reply was that she used this:
add_filter( 'comment_form_defaults', 'custom_comment_form_defaults' ); function custom_comment_form_defaults( $defaults ) { $defaults['comment_notes_after'] = '<p class="subscribe-to-comments" style="clear: both;"> <input id="subscribe" type="checkbox" style="width: auto;" value="subscribe" name="subscribe"> <label for="subscribe">Notify me of follow-up comments by email</label> </p>'; return $defaults;
Dunno if that helps at all, I don't have enough knowledge to know.
One final strange thing. I tried Carasmo's code when she first posted it to me, and it didn't work, but when I deactivated plugins and tried a different theme it appeared to work until I reinstalled the plugins and reverted the theme. But when I do the same now, it doesn't. Again, don't know if that helps.
As an aside, I reckon it would be great if StudioPress wrote a combined subscription plugin.
April 20, 2016 at 7:51 am #183978Christoph
MemberThe code works just fine.
I wouldn't have said it does without testing.
http://screencast.com/t/bRxHDqCdaZYou will not see the signup field when you are logged in.
Make sure you are logged out or use an incognito window.
Clear all the caches (e.g. in your browser, plugins, CDN and hosting).
April 21, 2016 at 2:38 am #184048unklee
MemberHi Christoph,
You were right. It is working now thanks. I think the problem was that I had been trying to get both this and the Subscribe2 plugin working, I had tried many times with several different email accounts and several different posts, and I got a little confused about what I had tried. Sorry to get that wrong and thanks for your help.
April 21, 2016 at 2:52 am #184049unklee
MemberActually, I'm sorry, but I must say I'm still confused. It looks like I can subscribe to comments without commenting, but there's no checkbox to subscribe to comments if I AM commenting. Is that correct, or am I totally missing it?
Thanks again.
April 22, 2016 at 3:39 am #184147unklee
MemberI think I've found a solution for the checkbox.
This Subscribe to comments thread on the WordPress forum points out a bug in the Subscribe to comments code at line 168, which is:
add_filter( 'comment_form_defaults', array( $this, 'add_checkbox_to_default' ));
I don't pretend to understand it exactly, but commenting out the line allows the checkbox to appear. So with your help I have the"subscribe without commenting" button, and with that hack I have the "subscribe to comments if commenting" checkbox.
So thanks. Now just to style the comments and buttons (should be OK), and change the comment notes (may be a little more difficult).
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.