本帖最後由 luguokankan 於 2013-7-10 19:02 編輯
4 W4 \. ?% `5 a$ |/ ]4 x# L- S: d* m! ?& L3 P7 y% Q
一般發佈文章我都喜歡隱藏發佈時間,所以分享一下.
. s/ M/ d! ]2 b8 a5 N+ F5 r最簡單自動的方法是在模板的functions.php中加如下代碼:
X& h: `' d0 k# ~; I- I/ K
' \% @8 s* `( a代碼加在開頭部分,在 <?php後即可.
6 U, f/ b6 z4 _, \- function jl_remove_post_dates() {
6 \& i; e" Z" n5 p4 h4 g - add_filter('the_date', '__return_false');
' l1 ?7 S$ a/ n5 B8 G0 p+ h - add_filter('the_time', '__return_false'); X+ j) }0 h, q5 n2 n
- add_filter('the_modified_date', '__return_false');
5 t2 R8 V2 T' P8 ^4 Y9 D9 [ - } 2 X( j7 k9 h% z! I' k
- add_action('loop_start', 'jl_remove_post_dates');
複製代碼 (Note: This method requires WordPress 3.0 or above) x) Q4 U4 K7 i2 {
5 X9 Z6 Q0 B) T
- Z( Z7 L# [! t# A: C' U
|