本帖最後由 luguokankan 於 2013-7-10 19:02 編輯 : l) e# K. X* f4 I* k! A6 s
5 s+ R) B; t7 h) S8 X一般發佈文章我都喜歡隱藏發佈時間,所以分享一下.
4 L$ M# V7 L; s' Q6 @% [3 K最簡單自動的方法是在模板的functions.php中加如下代碼:' f# v' R. z4 M( u W* m3 p4 W/ s
3 q! w" t3 J" Z; n代碼加在開頭部分,在 <?php後即可.
( l7 Y) G0 ~8 u9 X- function jl_remove_post_dates() { ) B# p- i6 m6 g' F' b
- add_filter('the_date', '__return_false');
' X( ?% h+ b! A% H# e% Z, w; D - add_filter('the_time', '__return_false'); % ^/ S( E$ n& K8 j! ~/ t3 K. T' S- ^4 V
- add_filter('the_modified_date', '__return_false');
8 L! @4 v" Y( D9 Z7 w - } 8 Y/ T) @2 k% J; c* J" S) l
- add_action('loop_start', 'jl_remove_post_dates');
複製代碼 (Note: This method requires WordPress 3.0 or above)
6 X% {- ]+ K1 M) t' c7 ]' a0 g' m# j" b
% ?0 g3 N, A8 e3 e+ L7 r+ U
|