WordPress.org

Ready to get started?Download WordPress

Forums

Popup comments in permalinks: is it possible? (9 posts)

  1. clea
    Member
    Posted 9 years ago #

    I have been searching through the forums (http://wordpress.org/support/topic.php?id=20919) to find a solution to this, but I haven't been able to implement it in WP 1.5.

    By default all permalinks show comments embedded (see, for example: http://www.grandecorniche.com/fotolog/?p=83) while the index page shows popup comments (http://www.grandecorniche.com/fotolog/).

    Is it possible to have permalinks display popup comments? How?

  2. Kafkaesqui

    Posted 9 years ago #

    First make sure this is in the <head> portion of your template(s):
    http://codex.wordpress.org/Template_Tags/comments_popup_script

    <?php comments_popup_script(); ?>

    Next, if you're using 'comments_link(), replace it with:
    http://codex.wordpress.org/Template_Tags/comments_popup_link

    <?php comments_popup_link(); ?>

    You can set up a separate template for this in your theme, as well (comments-popup.php).

    Finally, if you want the link to appear on the permalink (single post) page, you'll need to do a tiny bit of editing to the WP source (not sure why it isn't the default). In:

    wp-includescomment-functions.php

    Locate the function comments_popup_link() (about line 90). In this, change:

    if (! is_single() && ! is_page()) {

    to:

    if (! is_page()) {`

  3. Kafkaesqui

    Posted 9 years ago #

    The last line should be:

    if (! is_page()) {

    Ignore the ending tick.

    (Oh, to have edit turned back on!)

  4. clea
    Member
    Posted 9 years ago #

    Thanks Kafkaesqui, but you only solved half of my problem...

    The link now appears on the permalink page, that's right. But I still see the comment form embedded on that page (take for example http://www.grandecorniche.com/fotolog/?p=78).

  5. clea
    Member
    Posted 9 years ago #

    Hey, I did it! After adding the 'is_page' code that you mention, I commented the line:

    '<?php comments_template(); ?>'

    So it now looks like: '<?php //comments_template(); //?>'

    And apparently that solves the problem. Now I just see a nice link to the popup comment window.

    Thanks!

  6. Tessa
    Member
    Posted 9 years ago #

    I've got the trouble that when I click on comments the pop up does open, but with the index page of my site. I've read through this several times, but I can't figure it out. I'm fairly new to php and all that.

    When I hover over the link you'll see: http://www.whispering-words.com/?comments_popup=1 , then it goes to the index page when you click on it.

    (to see: http://www.whispering-words.com/indexx.php )

  7. jivyb
    Member
    Posted 8 years ago #

    Hi. I'm using a template that uses this technique. But in the popup comment window it comes up with my default background image and I need a different one. Is there a way to change the style sheet that gets called?

  8. planb247
    Member
    Posted 7 years ago #

    I'm having a similar problem at http://www.joshandtamra.com/wp/.

    I've got the comments_popup_script in my header file, and in both my index.php and single.php I've got the comments_popup_link in the "loop" (I'm assuming this is where Kafkesqui was talking about to put it above but it's sort of vague). And, in my includes/comments-functions.php it only says

    if (! is_page()) {

    not is_single. yet I still can't get the link to the popup comments to show up on the permalink pages. for example:
    http://www.joshandtamra.com/wp/?p=27

    I've searched the forums and this thread appears to address the exact problem, yet it's not solving my issue for some reason. Thanks in advance for you help.

  9. planb247
    Member
    Posted 7 years ago #

    btw, if it helps at all I'm using a heavily modified (by me) version of the Ice theme by Geo. and my index.php and single.php files are identical.

    (and also bumping to see if anyone can help)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.