Comments not displaying after changing theme

After the kerfuffle of logging in and acquiring the theme, I got to the code: $comm = get_option( ‘woo_comments’ ); if ( ‘open’ == $post->comment_status && ($comm == ‘post’ || $comm == ‘both’ ) ) { comments_template( ”, true ); } Your comments are not showing because in the woothemes settings, they have not been … Read more

Enable comments for post when comments meta box removed

Filter the ‘comments_open’ check. It happens inside of the function with the same name, and that function is called in a theme usually like this: comments_open() and comment_form( array ( ‘comment_notes_after’ => ” ) ); This is how the filter works: add_filter( ‘comments_open’, ‘wpse_98775_comment_check’, 10, 2 ); function wpse_98775_comment_check( $open, $post_id ) { if ( … Read more

Returning error upon comment being flagged as spam

This is how I’ve handled passing messages back to the user before: within your current function, set a transient with your message: set_transient( ‘admin_notice’, ‘Please put down your weapon. You have 20 seconds to comply.’ ); Then add a new hooked function: function admin_notices() { $notice = get_transient( ‘admin_notice’ ); if ( $notice ) { … Read more

Fatal error: Cannot redeclare comment_theme()

Your comments.php is included multiple times for some reason. Look for comments_template() – maybe it is called too early. Each time that happens, PHP tries to create the function comment_theme() again. This cannot work, function names must be unique. Move the function declaration to the functions.php. So everything including … <?php function comment_theme($comment, $args, $depth) … Read more

WordPress comments – delimiter “/” not found

I found a soloution and what causes it. It was not really the delimiter that was the problem it was becasue a user made duplicate posts. Solution: Replace $notify_message .= preg_replace(‘#[\s]+#’, ‘ ‘,sprintf( get_comment_meta($comment->comment_ID, ‘title’,1))) .’ skrev:’. “\r\n” . $comment->comment_content . “\r\n\r\n”; With $notify_message = preg_replace(‘/[\s]+/’, ‘ ‘,sprintf( get_comment_meta($comment->comment_ID, ‘title’,1)) .’ skrev:’. “\r\n” . $comment->comment_content … Read more

Separate jQuery for Individual Comments?

Replace your jquery with this <script type=”text/javascript”> (function($){ $(document).ready(function() { var $option = $(‘.option’); var $fruit = $(‘.fruit-name’); var $last; var parent $option.click(function() { parent=$(this).parents(‘.comment-form-rating’); $(‘.fruit-name’,parent).val(this.innerHTML) }) }); })(jQuery); </script> your script not working because .fruit-name not contain correct reference variable. Updated for debugging put code and check. <script type=”text/javascript”> (function($){ $(document).ready(function() { var $option … Read more