WordPress.org

Ready to get started?Download WordPress

Forums

comments_popup_link (5 posts)

  1. andy_b
    Member
    Posted 5 years 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??

  2. andy_b
    Member
    Posted 5 years ago #

    bump.

    any ideas?

  3. dougwaltman
    Member
    Posted 5 years 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/

  4. yakobabaidullah
    Member
    Posted 4 years ago #

    so.. this is the solution till now?

  5. bestfoot
    Member
    Posted 4 years ago #

    Seems to work fine.

Topic Closed

This topic has been closed to new replies.

About this Topic