Created
February 14, 2020 14:39
-
-
Save jacmaes/3fa5709a741eef2b03254c97541a15d9 to your computer and use it in GitHub Desktop.
Find pages by date #pw #php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Kreativan's gist: https://gist.github.com/kreativan/85c697b18b286a9cc0be70e35acb0a9d | |
<?php | |
// Find Pages by date | |
$year = date('Y'); | |
$month = date("F"); | |
$startTime = strtotime("1 $month $year"); | |
$endTime = strtotime("next month", $startTime); | |
$events = $pages->find("template=event, date>=$startTime, date<=$endTime"); | |
// Find pages older then 30 days | |
// baed on modified date | |
$older_pages = $pages->find("template=ad, modified<='30 days ago', limit=10"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment