Comments open for a time period (3 posts)

  1. katutxakur
    Posted 4 years ago #


    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
    Posted 4 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
    Posted 4 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