Forums

comments on "pages" (8 posts)

  1. bounce
    Member
    Posted 7 years ago #

    when i create a page there's no comment form on it. i put the code below to page.php but it didn't show any comment link or else.
    how can i do this?

    <?php comments_popup_link('no comment', '1 comment', '% comments'); ?>

  2. Kafkaesqui
    Moderator
    Posted 7 years ago #

    Your template must have this to display comments/comment form in The Loop:

    <?php comments_template(); ?>

  3. bounce
    Member
    Posted 7 years ago #

    thanks

  4. bob46802
    Member
    Posted 7 years ago #

    I put mine here in the page.php file
    <?php endwhile; endif; ?>
    <?php comments_template(); ?>
    <?php edit_post_link('Edit this entry.', '', ''); ?>

    and it works fine :)

  5. Usayd
    Member
    Posted 7 years ago #

    what if you want to add it to a non-looped page like my gallery page which still uses the require wp-header.php include?

    <?php comments_template(); ?> i dont think this works?

  6. lawtai
    Member
    Posted 7 years ago #

    i'm pretty sure it needs to be added within the loop to work.

  7. Usayd
    Member
    Posted 7 years ago #

    what if your page isn't using a loop? ie a totally seperate page like my gallery?

  8. realitym
    Member
    Posted 6 years ago #

    I guess you could always try to add a loop to it.
    Something along the lines of:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php endwhile; endif; ?>

    ¿? I don't know if this should or would work... Add it to your gallery page template and try to see if it works.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.