WordPress.org

Ready to get started?Download WordPress

Forums

Commenting on static pages (15 posts)

  1. DanielGutekunst
    Member
    Posted 9 years ago #

    I have static pages (php) that are not part of WordPress (but I could load any WP file from these).

    Someone should be able to comment on these pages like on Blog entries. It should be able to accomplish this in some way...

    any ideas?

  2. mcmike
    Member
    Posted 9 years ago #

    I have NO idea what you are talking about.. Maybe a URI to show ?

  3. DanielGutekunst
    Member
    Posted 9 years ago #

    What don't you understand? e.g. you have a static site S:
    S := http://www.domain.net/something/strange.php

    And you want to allow users to add comments on S. Instead of using a new script, it would be nice, to use the functions WP provides for storing and printing comments.

  4. Root
    Member
    Posted 9 years ago #

    A static page with comments is not static. It is a blog page with a single post.
    Its all built in.

  5. Cypher
    Member
    Posted 9 years ago #

    However, if you are including _seperate_ PHP files on your webpage that aren't controlled by WordPress, then you'd have to implement your own commenting on it.

    You could use the Pages feature in WP 1.5 to create static pages and thus allow commenting on it.

    Regards

  6. philpeeps
    Member
    Posted 9 years ago #

    just include the commenting template tags from your loop in your page template

  7. Root
    Member
    Posted 9 years ago #

    Well there has been no mention of a page template. The pages are being described as not part of WP.

  8. philpeeps
    Member
    Posted 9 years ago #

    oops...I didn't read carefully enough...

  9. mcmike
    Member
    Posted 9 years ago #

    You could add the RunPHP plugin and re-write the pages to WP-Pages with the <phpcode></phpcode> tags from RunPHP :)

    Or if the pages are used at 2 different location you could use the require_once() function of PHP (with RunPHP etc.)... (just an idea)

  10. mcmike
    Member
    Posted 9 years ago #

    BY the way the I have no idea-tag should not be here was posted on another thread (I thought actually :P)

  11. DanielGutekunst
    Member
    Posted 9 years ago #

    There is no solution at this point.

    I postet this with care under "Plugins and Hacks" because I really need a hack.

    I thought about this way:
    1. Create a pseudo page with no content, just to have a new id for a new comment slot.
    2. Include WP headers in my own page (outter WP) and use the appropriate comment code with the id of the pseudo page...

  12. philpeeps
    Member
    Posted 9 years ago #

    i dont understand why you do not use the pages feature instead. Is there something on those pages that cannot be included on a wordpress page template?

    A link would help so we can see what you are trying to include on this page, but AFAIK, you can include any php you need on a page template, have a loop looking for the page and comments and be done with it...

    http://codex.wordpress.org/pages#Pages_can_use_Different_Templates

    I am using a static page with comments on my "about" page on my site with no problems.

  13. srpittman
    Member
    Posted 9 years ago #

    I am using the Pages feature to create additional content pages for my site at http://www.tpimagazine.net. Although I have the option checked to "Allow Comments" on the newly created pages, the option to post comments on the page do not show up. I went to philpeeps blog and his site has multiple pages with the ability to post comments on the additional pages. What do I need to do or is something broke?

    When logged in as admin the option that shows at the bottom of the page is "edit this...", but when I'm logged out, no option is displayed....

  14. Jinsan
    Member
    Posted 9 years ago #

    why don't you create a template for your pages, and add:

    <?php }?>
    <p class="comments_link">
    <?php
    $comments_img_link = '<img src="' . get_stylesheet_directory_uri() . '/images/comments.gif" title="comments" alt="*" />';
    comments_popup_link('No Comments', $comments_img_link . ' 1 Comment', $comments_img_link . ' % Comments');
    ?>
    </p>

    <?php
    if ($pcount_lp == 1){
    comments_template();
    } ?>
    <?php }?>

    or something liket aht to the template. Enable comments in the page with the checkbox and I think it will work. Just copy the comment part of your index file into the page template file. Or will this not work?

  15. vcourtney
    Member
    Posted 9 years ago #

    srpittman: What I did to get comments on a static page was basically yoink the wp loop--including the comments loop--from index.php and throw it in a new page template. Write your content in the "write page" area, make sure you use your tweaked template, and you should be fine.
    (I made a guestbook page-- http://www.virtualcourtney.com/guestbook/ )

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.