2015-02-05 38 views

回答

0

裏面的WP循環就可以得到該職位的日期與內置的the_date(「Y」)的WP functino

所以在WP循環只需要檢查,如果日期==像這樣的東西。

<?php 
if (have_posts()) { 
    while (have_posts()) { 
     if(the_date('Y') == '2015'): 
     the_post(); 
     else: 
     continue; 
     endif; 
    } // end while 
} // end if 
?>