本帖最後由 非常小黑 於 2013-10-15 00:05 編輯
# N/ \* h; [+ M% C, `/ j" v# I0 y- U6 G( b& S
默認的列表頁,顯示的文章,都是全部文章(或者摘要)
+ f! k" r. A( F; p0 I怎麼修改才能只顯示post標題列表?' Q7 W* X9 w5 N! v$ v+ q
category.php這個文件代碼如下:- get_header(); ?>1 m' K( Q. F% [6 ~+ P
- . S" A% o9 s1 G' a9 D
- <section id="primary" class="site-content">
7 Q. O$ [% E5 i8 g - <div id="content" role="main">
( {4 M5 S3 O8 g - 4 E# R1 [8 V! C! m1 ?
- <?php if ( have_posts() ) : ?>
2 _: L5 \# n( j. ] R0 B - <header class="archive-header">0 p. m( A3 ]( v. K
- <h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>
) L+ M0 S, K& ~2 F9 q8 q - % k" m# J( k8 b% [- m; v
- <?php if ( category_description() ) : // Show an optional category description ?>. R& V7 p8 r6 Q; m1 V
- <div class="archive-meta"><?php echo category_description(); ?></div>
' m/ v* A$ C/ }& p) Q7 Y( z - <?php endif; ?>
0 i, X3 d% V1 e& Y - </header><!-- .archive-header -->! Y9 w" C+ A [& m j
- # O+ Y, d+ S J, D" b: X$ G
- <?php1 m+ w+ J5 P- f% |: i2 D1 _" e
- /* Start the Loop */
0 w. m) O5 G/ j/ S/ Y! b. i6 O! Q - while ( have_posts() ) : the_post();% `( q/ d4 \; k( \4 l& [2 s
1 a5 K3 n/ |5 f* O: X- /* Include the post format-specific template for the content. If you want to7 V* y" ^6 Q) j; g3 f8 V
- * this in a child theme then include a file called called content-___.php" w& L+ J# h7 C6 I" }9 z
- * (where ___ is the post format) and that will be used instead.
5 U# U1 j$ a7 \4 j; ^' \4 A - */
# t1 e; K$ K" Z - get_template_part( 'content', get_post_format() );( h% s3 s3 C0 H) J3 ]: M( Y/ N
- 1 u# S F( E9 t! E/ z6 M6 K
: |& D+ B0 ], \" ~- endwhile;
/ L1 p+ f3 ]2 U+ P8 l - - o. k) c7 u1 Y
- twentytwelve_content_nav( 'nav-below' );! S5 H* e! X) m6 R' R( T; b/ @
- ?>! C/ H( s( I0 E! E3 Z" f; T
- 5 w8 z: _7 z% A. U
- <?php else : ?>
1 D8 Y7 }' t) H0 X1 P/ J' y9 [ - <?php get_template_part( 'content', 'none' ); ?>* ~& o }8 L- S% W8 i* W
- <?php endif; ?>
) V5 `9 n' Z) t
# k. o+ X& |5 U& a" I5 h- </div><!-- #content -->! s+ \7 G h8 F L3 M
- </section><!-- #primary -->! q3 f ?' Y% ?# L4 P9 b: y9 p
3 P6 i: V4 V7 u- <?php get_sidebar(); ?>0 O" N# r+ \! O a8 N+ I" {
- <?php get_footer(); ?>
複製代碼 get_template_part( 'content', get_post_format() )/ Q. e: O) d+ W. P0 c5 [: n- p
應該是post的格式吧?/ e; h l4 _$ n+ e: X# i- B2 Y
然後我在content.php裡面,找啊找,沒找到對應的 if is_category() 這個判斷。' L. L, W1 l9 J" t% Z+ ^
那麼我傻了。。。
% W$ |% a" ~( O7 F* `$ {各位神出來幫忙啊。0 C y/ I8 H3 H; f `8 M
( v/ z- c% {) F6 V' J
+ A6 n7 h! y0 D- b! t
|