How to use the “existence of comments” in an IF statement
-
I wanted to use a
php if (there are comments) { show this and that }
syntax so I looked up comments.php and found this
?php if ($comments) : ?
1. So I used this in archives.php (which is my substitue for index.php) within The Loop as
php if ($comments) { blabla }
but it returns false on every post, including those which have comments.
2. I then tried pulling out the results from comments_popup_links
php if (comments_popup_link(‘0′,’1′,’1′)==’1’) { echo(‘there are comments’); } ?
and it didn’t work. (the plugin just echoes the stuff on screen and doesn’t pass on variables)
So how can this be done? Help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to use the “existence of comments” in an IF statement’ is closed to new replies.