本帖最後由 luguokankan 於 2013-7-10 19:02 編輯
' t( f4 j5 Y9 |1 L& ^0 ~1 R5 L: X$ S0 D9 i/ \& @
一般發佈文章我都喜歡隱藏發佈時間,所以分享一下.
' W* B9 O1 r7 C1 W8 S* C# A最簡單自動的方法是在模板的functions.php中加如下代碼:
0 N- n/ g+ H$ ]+ Z5 f4 f( `3 S' A0 s+ W' _ f
代碼加在開頭部分,在 <?php後即可.
2 W% |/ T: T5 x5 _* h0 W- function jl_remove_post_dates() {
# ^- \8 x' A5 j - add_filter('the_date', '__return_false');
$ G2 S6 \/ w/ V7 }, m - add_filter('the_time', '__return_false');
! Q% p3 C4 W$ l3 @5 Z( i& T9 s, \ - add_filter('the_modified_date', '__return_false');
; Q8 h5 ]# z" R - } 5 s. |$ Q( K/ P6 T
- add_action('loop_start', 'jl_remove_post_dates');
複製代碼 (Note: This method requires WordPress 3.0 or above)
( d# f0 Y% R' F ~' g. K
+ r* K' `5 V& U& ~( U6 K# O* h) y9 ~- B( w p2 ~2 e/ R: t5 @
|