Forum

Thread tagged as: Question, Problem

How to update a content by setting a date?

Hi, Quick question.

How do I update a section content by setting a date to it?

This is my code on on the home page

perch_content_custom('Writer Area',[
        'page' => '/writers/*',
        'template' => 'reg-writer.html',
        'filter' => 'writersdate',
        'match' => 'gte',
        'value' => date('d-M-Y'),
        'count' => 1
    ]);

basically its a featured writer section and there is a new featured writer per month and so the content will change on the first day of the month.

Vaneza Mae Aumento

Vaneza Mae Aumento 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Something like:

perch_content_custom('Writer Area',[
        'page' => '/writers/*',
        'template' => 'reg-writer.html',
        'filter' => 'writersdate',
        'match' => 'eqbetween',
        'value' => date('Y-m-d 00:00:00').', '.date('Y-m-31 23:59:59'),
        'count' => 1
    ]);