WordPress.org

Forums

The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

comments on "pages" (8 posts)

  1. bounce
    Member
    Posted 11 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

    Posted 11 years ago #

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

    <?php comments_template(); ?>

  3. bounce
    Member
    Posted 11 years ago #

    thanks

  4. Rob Poitras
    Member
    Posted 11 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 11 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 11 years ago #

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

  7. Usayd
    Member
    Posted 11 years ago #

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

  8. realitym
    Member
    Posted 11 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.