Marty Walker Posted October 8, 2012 Posted October 8, 2012 Hi, Is there a way to check if any comments have been posted on a page? I've tried this is no avail: <?php if($page->comments) { echo "something"; } Regards Marty
Marty Walker Posted October 8, 2012 Author Posted October 8, 2012 I got it: <?php if($page->comments->count() > 0) { echo "something"; }
ryan Posted October 8, 2012 Posted October 8, 2012 Either count($page->comments); or $page->comments->count(); will work. You can also do it from selectors before a page is even loaded: $pages->find("comments.count>0");
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now