WordPress.org

Ready to get started?Download WordPress

Forums

comments_popup_link() doesn't render link on Pages. (5 posts)

  1. jared essig
    Member
    Posted 6 years ago #

    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?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    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.

  3. Jauhari
    Member
    Posted 5 years ago #

    How to Hack it? anybody can solve without hack?

  4. ajaswa
    Member
    Posted 5 years ago #

    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...

  5. whooami
    Member
    Posted 5 years ago #

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

    Hilarious.

Topic Closed

This topic has been closed to new replies.

About this Topic