WordPress.org

Support

Support » How-To and Troubleshooting » comments_popup_link() doesn’t render link on Pages.

comments_popup_link() doesn’t render link on Pages.

  • I have the following on my page template

    <?php comments_popup_link(); ?>

    And I have the following in my html head

    <?php comments_popup_script(); ?>

    Still, no link is output. I assume that this tag is turned off by default on Pages. Doesn’t anyone know where that is configurable and/or hackable?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    @otto42

    WordPress.org Tech Dude

    comments_popup_link does not work on Single Post pages or on Page Templates. It’s meant for the index or archive pages. You can’t do popup comments when viewing a single post or single page.

    If you want to hack it to work, it’s defined in comment-template.php.

    How to Hack it? anybody can solve without hack?

    To get this to work open up comment-template.php find the comment_popup_link function and then look for

    if ( is_single() || is_page() )

    replace it with

    if ( is_single() )

    This will allow you to use the comment_popup_link() function on “pages”. One more thing I had to hack to get wordpress to work as a decent CMS…

    One more thing I had to hack to get wordpress to work as a decent CMS…

    Hilarious.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘comments_popup_link() doesn’t render link on Pages.’ is closed to new replies.