Hi
I've got a problem when I try and add a comment to a post. It doesn't let me unless I'm the Admin.
It used to work until I did a major mod today which I'll try and explain in the hope that someone out there can point me in the right direction.
There used to be 2 types of 'post_status' in the wp_posts db. They were "publish" and "draft". I needed a third option so used "pending".
Now if I go to a "pending" post and go to add a comment the scripts bombs out (without error) at the following point in /wp-includes/comment-template.php
function comments_template( $file = '/comments.php', $separate_comments = false ) {
global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
// ***********************************************
// Script fails at the condition below and returns
// This leaves just a blank screen
// ***********************************************
if ( ! (is_single() || is_page() || $withcomments) )
return;
Does anyone know why a post that has the post_status set to "pending" would fail that IF statement? (or maybe I'm off on the wrong track here and something else is causing that IF statement to fail???)
*** UPDATE ***
I've just done some error trapping and I've found that in the posts that it allows me to comment on the is_single() is a 1 where as the others there is no value in is_single().... so, does anyone know where is_single() gets set??
*** END OF UPDATE ***
Basically if I'm logged in as an admin I can write messages but anything else and I can't?
Also, if I comment out the above statement I just get die ('Please do not load this page directly. Thanks!'); error from the /themes/mytheme/comments.php file.
I've been tearing my hair out with this one all afternoon but I'm new to WordPress and not that experienced in php either so I'm hoping I'm just missing something simple.
Any help (I mean any at all) will be really really appreciated
Many thanks
John