WordPress.org

Ready to get started?Download WordPress

Forums

Comments open for a time period (3 posts)

  1. katutxakur
    Member
    Posted 2 years ago #

    Hi!

    I need to enable comments only for a time period that will be entered in 2 custom fields. Any hint for achieving that?

  2. markparolisi
    Member
    Posted 2 years ago #

    You can update your comments template with a conditional that compares those two dates (start and finish) with today's date.

    $today >= $start && $today <=$finish

    You are gonna want to work your new conditional into the if(comments_open())conditional that's likely already there.

  3. katutxakur
    Member
    Posted 2 years ago #

    thanks for your reply markparolisi. That can be enough for what I need!

    But doing that way, comments won't be closed at all. Could that become a problem (for example bots still capable of writing spam)?

Topic Closed

This topic has been closed to new replies.

About this Topic