Tag Info

Hot answers tagged

4

When we post an empty anonymous reply, we get the following errors: The part of BBPress that's responsible for handling this, is the bbp_new_reply_handler() function, in the file /bbpress/includes/replies/functions.php. It contains these lines that are of interest to us: // User is anonymous if ( bbp_is_anonymous() ) { // Filter ...


2

Filter comment_form_defaults and add your code to the textarea. Sample code, not tested: add_filter( 'comment_form_defaults', 'wpse_120049_extend_textarea' ); function wpse_120049_extend_textarea( $args ) { $args['comment_field'] .= '<p>Extra text.</p>'; return $args; }


2

Don't build your own form and don't modify comments.php - it's purpose is little bit different and I don't think you should include it inside sidebar. Just put comment_form function call in your sidebar template. It takes 2 parameters: args and post_id. So you can do it like this: $args = array( ... // your custom arguments (you can leave it empty ); ...


1

Try use this action instead <?php add_action("comment_form", "append_notice"); function append_notice($post_id) { ?><p>Here is a notice</p><?php } ?>


1

When I developped this little plugin, I used a part of the code of Danny van Kooten's plugin : 'Recent Facebook Posts'. The content of the plugin folder is : classes / facebook-php-sdk/ base_facebook.php facebook.php fb_ca_chain_bundle.crt class-fcwpc.php fbconnect_wordpress_comments.php fbconnect_wordpress_comments.php: ...


1

I realized that comment-reply.js is not loaded and it fixed the issue. Could someone explain? I have no idea what happened. So the fix was adding wp_enqueue_script( 'comment-reply' ); to my plugin code.


1

In the first version of your code, you don't check if user is logged in. In the second attempt your logic is wrong, I guess. So your code should look like so: <?php // If CPT and not logged in, display a message: if ( 'CPT' == get_post_type() && !is_user_logged_in() ) { echo '<p class="must-log-in" style="padding-left:20px; ...


1

I was searching for the same solution and at last i found the solution, the below code worked perfectly for me, I wanted to add "btn btn-primary" class to the submit button in comment form. ob_start(); comment_form( $args ); $form = ob_get_clean(); $form = str_replace('class="comment-form"','class="comment-form"', $form); echo ...


1

You can use filters in custom functions to modify the default output of the comments form via your child themes functions file. Modify the comment form "Leave a reply" text. add_filter( 'comment_form_defaults', 'wpsites_modify_comment_form_title' ); function wpsites_modify_comment_form_title( $defaults ) { $defaults['title_reply'] = __( 'Leave a Comment' ...


1

Your theme should have a comments.php file. Can you just remove the field there? For instance, my comments.php files has the following code: <p class="field"><label for="url"><?php _e('Website', 'theme1721'); ?> </label><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" ...



Only top voted, non community-wiki answers of a minimum length are eligible