• we run a static website with WordPress in the root directory. So I disabled the comments form in page.php:
    <?php comments_template( '', true ); ?>

    like this:

    // <?php comments_template( '', true ); ?>

    But we want to make a new instance of WordPress in a /blog/ directory. I want people to be able to request access to that instance by filling out a form with their name, email address, and member number (to prove their identity).

    We will then sent them login information with a temporary password. I was thinking I could temporarily enable the comments window by adding the

    <?php comments_template( '', true ); ?>

    directly on the page in HTML mode. Will that work? Will it again be disabled when they move away from this page? Is there a better way to do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • No – that won’t work. You can’t add PHP to a page or post’s content. It has to be added to the relevant template file. Since this is a separate install of WP, why not configure it to only allow registered users to comment and do not allow people to register on the new site as subscribers? That way, you control who registers and, therefore, who can comment.

    Thread Starter iechefs

    (@iechefs)

    Thank you. And thank you for that GREAT advice about never modifying the core WordPress PHP files. It’s like never logging in as “root” unless there is a really good reason to do so.

    Okay, I guess I’ll need to write a form in a new PHP file in the root directory that gathers the necessary information. Then I can call it from my BLOG page. I was hoping to place it into the “needs moderation” mode (or whatever it is called) instead of sending it to me as an email.

    The reason I’m having to go through all this extra hassle is that the rest of the board hates the idea of our whole website looking like a blog. So I disabled the comments window. Anyway, the comments window doesn’t ask the required questions. I’ll need to create a custom form.

    I’m not too sure how to do this, but I’ll try to figure it out, then go to the PHP Freaks forum to ask for help.

    Is there a plug-in that does something like what I’m trying to accomplish? I could start with that then tweak it to finish the job.

    I guess I’ll need to write a form in a new PHP file in the root directory that gathers the necessary information.

    What about using a forms plugin such as https://www.deliciousdays.com/cforms-plugin/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘temporarily enabling comments form’ is closed to new replies.