Problems with comments on existing website
-
Hi,
I’m using WordPress on an already existing website and I’m getting the posts from the database using php and then applying my own formatting.
I currently have a problem with adding comments for a posts. I’m using the function wp_insert_comment() to insert the comment which seems to be working.
The code for adding the comment and displaying all comments for the current post is on the same page. The layout of the code is as follows.
if(isset($_POST["comment_post_ID"])) { Code to insert comment if comment has been submitted } if(isset($_POST["p"])) { Code to show a single post including all of the comments } else { Code to display all of the posts }So the code for inserting comments and showing a single posts happens one after the other., The problem is that if I add a comment the comment is not displayed amongst all of the other comments on the page until I refresh the page.
Is there some sort of cache that comments go into that has to be updated?
Thanks,
Pedro
The topic ‘Problems with comments on existing website’ is closed to new replies.