Support » Fixing WordPress » Comments link in title

  • I’ve got comments working on my posts, single page posts and selected pages (using a cloned and modified template).

    I also want it to display the number of comments for each post or page, in the title area.

    In each post on the front page I’m using the following:

    <div class=”post_comments”>
    <?php comments_popup_link(__(‘No comments’), __(‘Comments (1)’), __(‘Comments (%)’)); ?>
    </div>

    Which displays the number of comments I have for a post. Works perfectly.

    You can see here: http://www.rsart.co.uk

    I’m using the same code on my singlepost and pages, but this call isn’t working (I’ve resorted to using   for now to stop the css breaking)

    The comments box does work however, I just can’t display the No comments/ Comments(X) in the title area.

    I have got <?php comments_popup_script(); ?> in the header.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Actually, I’ve just taken <?php comments_popup_script(); ?> out of the header, as I dont want the popup window.

    Still no joy in getting the number of posted comments to dissplay on any page other than the index.

    I’ve just upgraded to the latest version of WordPress (scary but quite simple – MAKE A FULL BACKUP!), jut in case it was a bug.

    Still no joy though

    If memory serves me correctly, comments_popup_link() is supposed to work that way, i.e. show number of comments on index page, but not on single/permalink pages.

    For a template tag that works everywhere, I believe you have to use comments_number().

    Thank you!

    I wrapped that in an anchor, linked to “#respond”, and it’s just what I needed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Comments link in title’ is closed to new replies.