Forums
Home / Fixing WordPress / comments_popup_link
(@andy_b)
15 years, 3 months ago
I am using comments_popup_link on my blog in the following way:
<?php comments_popup_link('<img src="t.gif" onmouseout="this.src=\'t.gif\';" onmouseover="this.src=\'t2.gif\';"/>', '<img src="t.gif" onmouseout="this.src=\'t.gif\';" onmouseover="this.src=\'t2.gif\';"/>', '<img src="t.gif" onmouseout="this.src=\'t.gif\';" onmouseover="this.src=\'t2.gif\';"/>'); ?>
basically a rollover image.
Now this works fine when placed in the main index.php page. —— i am updating my blog and have created a comments.php file which now includes the code above.
i am including this comments.php file in the following way from my index.php page:
<div class ="commentsall"> <?php $wp_query->is_single = true; comments_template(); $wp_query->is_single = false; ?> </div>
When i do this the comment_popup_link is ignored completely!!
Any ideas why??
bump.
any ideas?
(@dougwaltman)
15 years, 2 months ago
Hi Andy. If you’re still having trouble with this, like I was, I found Nathan Rice’s solution very helpful:
<a href="<?php the_permalink(); ?>#comments"><?php comments_number('No Comments', '1 Comment', '% Comments'); ?></a>
Source: http://www.nathanrice.net/blog/comment-link-in-singlephp/
(@yakobabaidullah)
14 years, 5 months ago
so.. this is the solution till now?
(@bestfoot)
14 years, 3 months ago
Seems to work fine.
(@andy_b)
15 years, 3 months ago
I am using comments_popup_link on my blog in the following way:
basically a rollover image.
Now this works fine when placed in the main index.php page.
——
i am updating my blog and have created a comments.php file which now includes the code above.
i am including this comments.php file in the following way from my index.php page:
When i do this the comment_popup_link is ignored completely!!
Any ideas why??