Required Field for Comment parent only?

$comment is not set inside that function. Look into variable scope. $_POST[‘comment_parent’] should be set though. function custom_validate_comment() { //validate rating if( isset($_POST[‘comment_parent’]) && $_POST[‘comment_parent’] === 0) { if( empty( $_POST[‘rating’]) ) wp_die( __(‘Error: Please Include Your Rating (0 to 5 Stars)’) ); } } add_action(‘pre_comment_on_post’, ‘custom_validate_comment’); You could also rewrite your function to take … Read more

How to remove website field in comment form?

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); ?>” size=”22″ tabindex=”3″ /></p> I would just remove it if I didn’t want visitors to have the option to … Read more

Get first comment link on the post itself

you can get comment link by wp function $args = array( ‘number’ => ‘1’, ‘post_id’ => your_post_id, // use post_id, not post_ID ); $comments = get_comments($args); <a href=”https://wordpress.stackexchange.com/questions/108654/<?php echo get_comment_link( $comments->comment_ID ); ?>”>postname</a>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)