【PHP】指定した期間中だけ表示を変えたい

キャンペーンなど指定した期間だけバナーを表示したいときなどに簡単に使えるコード

<?php
// キャンペーン期間を指定
if (time() >= strtotime("2017-01-01 00:00:00") && time() < strtotime("2017-03-01 00:00:00")) {
echo "<p>キャンペーンが開始しました</p>";
} else {
echo "<p>キャンペーンは終了しました</p>";
}
?>
<?php 
$current_time = strtotime('now');
$target_time = strtotime('2024-12-25 00:00');

if ($current_time < $target_time) {
    //期間内
} else {
    //期間外
}
?>

Warning: Undefined variable $additional_loop in /home/xs271582/amezo.net/public_html/wp-content/themes/amezo/index.php on line 47

Warning: Attempt to read property "max_num_pages" on null in /home/xs271582/amezo.net/public_html/wp-content/themes/amezo/index.php on line 47