• Resolved Matt

    (@webmasterifcj)


    Hello guys,

    Quick question I currently have a small bit of code that is pulling comments from a comment box on one page and displaying those comments on another page.

    Here is the code that I have on my page.php:

    <div id="comments">
    <?php if ( is_page('share-your-story')) {
    	$comments = get_comments('post_id=2583');
    	  foreach($comments as $comm) :
    		echo "<hr>"."<h3>".($comm->comment_author)."</h3>";
    		echo "<p>".($comm->comment_content)."</p>";
    	  endforeach;
    	}
    	else {
    	comments_template();
    	}
    ?>
    </div>

    Problem is that the comments are not going through the approval process is there anything to this code that I can add that will stop the comment from displaying automatically?

    Thanks,
    Matt

Viewing 1 replies (of 1 total)
  • Thread Starter Matt

    (@webmasterifcj)

    I got it… for those who need to know this here it is:

    Thanks to Richard M

    <div id="comments">
    <?php if ( is_page('share-your-story')) {
    	$comments = get_comments('post_id=2583&status=approve');
    	  foreach($comments as $comm) :
    		echo "<hr>"."<h3>".($comm->comment_author)."</h3>";
    		echo "<p>".($comm->comment_content)."</p>";
    	  endforeach;
    	}
    	else {
    	comments_template();
    	}
    ?>
    </div>
Viewing 1 replies (of 1 total)
  • The topic ‘How to place comments through the Comment Approval Process’ is closed to new replies.