I’m trying to utilize the comment function of wordpress to create a message box on the dashboard for my subscribers.
I made a comment-enabled dummy page.
Problem 1. After the comment has been submitted, I need the script to take my subscriber back to the dashboard.
–I created wp-comment-post2.php where I edited the $location.
Problem 2. I need the <?php comments_template(); ?> to work on some place other than the posts and the pages.
–I opened up wp-includes/comment-template.php, duplicated function comments_template, renamed the second one to comments_template2, and deleted the lines
if ( ! (is_single() || is_page() || $withcomments) ) return;
I also changed the function to refer to comments2.php(theme file) instead, and in comments2.php, I changed the form so it submits to wp-comments-post2.php instead.
Now, when I tried <?php comments_template(); ?>, it sort of works. I got some previously-submitted comments, but not the form. I can easily add the form manually if I have to, but the big problem is, the comments I got aren’t the comments from the page I made, but from other posts. They aren’t the latest comments, and they aren’t all the comments that were ever submitted. I’m a little puzzled on why wordpress chose to display those two out of five total comments.
How do I control what comments get pulled up?
- The topic ‘Message Box on Dashboard’ is closed to new replies.