Assuming that you are using the JetPack plugin and that your visitors will have JavaScript turned on, the following code should work (I have tested it. It works for me). Place it in your functions.php file.
function subscribeByDefault() {
?>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('#subscribe_comments').attr('checked', 'checked');
$('#subscribe_blog').attr('checked', 'checked');
});
}) (jQuery);
</script>
<?php
}
add_action('wp_footer', 'subscribeByDefault');
If you are using a plugin other than JetPack, you will need to find the ‘id’ of the checkbox in your source code and substitute it for what follows the # sign in the code above.
Thanks a lot for your reply. Greatly appreciated!
Will try this and would update!
(@curiouswriter)
11 years, 3 months ago
Hi,
I know that we can’t force readers to subscribe to our blogs but is there any solution that the box for follow/subscribe to comments/ would be ticked by default?
[ No bumping please ]