2015-02-05 55 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 
?> 
相关问题