本帖最後由 阿里爹地 於 2011-10-2 06:57 編輯
8 r2 `6 h# p' \' p
) H w8 M) ^6 |8 \這個主題相信非常的出名,很多wordpress愛好者都知道!
7 e# F7 f ?" {2 h; z2 w3 s U! \
最新版本首頁默認文章顯示第一段內容摘要,我現在想顯示全文,可是技術比較差,刪減修改了一些代碼好像沒用!: H. {7 ]9 f5 q
/ l4 t6 ]. q& L+ Q1 Z( w9 @$ e
所以特地請教朋友們怎麼辦?% p, B S1 d T+ t& `$ m
, }/ V$ G: W* J0 g4 J
如果哪位童鞋幫我解決了,送本店所有視頻教程!
, W4 n* v# P$ \- T o; H! E" H0 a. w: ?: c. U" C% X3 }; |
主題下載地址:http://www.xiaohanseo.com/wp-content/uploads/2011/06/xiaohan3.zip
* a# A+ {3 A& z1 `+ Z0 j# V m! z4 C) R4 k& w, ]2 }
目前網站效果: http://www.zhuanshen1986.com/3 K- {7 c2 x: d2 X n
D( @" t; T" g首頁index.php代碼如下:- <?php$ n$ G9 y# B p6 ^3 J
- get_header(); ?> H* ^5 `& l! M4 b+ t2 c# P
- <div id="container">
0 t- F& R+ t0 a2 _! l7 M7 @ - <div class="content">
2 ~5 ^% O! w# a0 A - <?php $options = get_option('xiaohan_options');
) Q. s8 V, W, h+ \; r* D - $wbid=$options['notice_content'];6 ?8 K+ T% h9 x. c: T a: p
- query_posts("showposts=1.&cat=$wbid"); if(have_posts()) : while(have_posts()) : the_post(); ?>+ u* ]" T) d$ M/ Y2 n, S( _
- <?php if(get_post_format( $post->ID )=='aside') : ?>) k9 k# d* t2 ~0 s3 a
- <div class="notice">
7 C$ J% G3 h" p- f - <div class="t"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></div>& Q& b1 V! y- W5 l% M7 H& [- E
- <div class="r"><span><?php the_time(__('m-d h:s')) ?></span><span class="com"><?php comments_popup_link('評論(<em>0</em>)', '評論(<em>1</em>)', '評論(<em>%</em>)', '評論關閉'); ?></span></div>! k4 p* X2 S9 {9 g$ a V
- </div>
B3 @# K: `6 f/ G/ s E# E; Y, w' i - <?php endif;?>
: b: h; [$ g( s y - <?php endwhile;wp_reset_query();?>
6 z( P8 o/ B8 u# R- L: O - <?php endif;?>
" P/ N! Q/ L' B1 m% y+ Q# `8 K4 M - <?php query_posts("$query_string.'posts_per_page=-1'&cat=-$wbid");if(have_posts()) : while(have_posts()) : the_post(); ?># Y. {; P0 f0 D
- <?php if(is_sticky()) : ?>
$ Z' r4 N# G+ L- X- N5 x0 o. P# S - <div class="sticky" id="post-<?php the_ID(); ?>">
0 I+ v$ x4 S# c. h$ P - <h2>[置頂] <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>3 P- b6 x9 x4 Y# ~$ q0 h8 `
- </div># x) ?- B& Y1 {/ J" [ E! f: A& A
- <?php elseif(get_post_format( $post->ID )=='') : ?>) G9 E* [4 E2 i1 Q; }
- <div class="post" id="post-<?php the_ID(); ?>">
$ ^3 U7 E/ m4 s& a( |% i6 g- j - <div class="date"><span><?php the_time(__('Y')) ?></span><span class="f"><?php the_time(__('m')) ?>月<?php the_time(__('j')) ?></span></div>' d* `( J# W$ r9 i9 n" j. K$ x
- <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
" o& I3 q( ~+ |0 G - <div class="info">& l% f) Y& G& J1 f4 E
- <span class="categories"><?php the_category(','); ?></span># e {3 e# e: Z& Q
- <span class="tags"><?php the_tags('', ', ', ''); ?></span>' |, M6 o. c2 o- I" Y- g
- <?php if ($options['author']) : ?><span class="author"><?php the_author_posts_link(); ?></span><?php endif; ?> w. O+ }$ R3 u
- <?php edit_post_link(編輯, '','»'); ?>, _% u* O+ b! J2 _2 Y4 B& {& u5 I
- <span class="comments"><?php comments_popup_link('<em>0</em> Comments', '<em>1</em> Comment', '<em>%</em> Comments', 'Comments off'); ?></span>
7 ~$ p+ X" |7 f/ j - <div class="clear"></div>
0 v: ?* m/ L8 n; S: [ - </div>" h6 |1 X' l) s0 r2 a$ J& N
- <div class="intro">. R! e$ E" Q! N: @
- <?php if(is_category() || is_archive() || is_home() ) {$ }: D) b3 f! K7 u& F$ y
- the_excerpt();
9 Q9 W' W, c5 }% n! S* f) T i - } else {; L# ^& J$ y5 F. Z( z
- the_content('Read the rest of this entry »'); ; [( y" H+ E+ X1 ^0 O2 F
- }
- k5 B5 |6 D# |& u/ O; [ - ?>
! [: ]! {% w6 g) E - </div>
# @/ N/ q& D" }; Y% d - </div>; C ~3 P( w- K: {3 Q
- <?php endif; ?>2 E- J9 P3 T; F% h* h# E
- <?php endwhile;else : ?>( z! K* `/ K0 M a
- <div class="errorbox">9 m2 K1 ?; \3 M0 |7 [6 M
- <?php _e('Sorry, no posts matched your criteria.', 'xiaohan'); ?>4 M' H x% q( V; k1 a
- </div>
/ V" `2 h1 [% d6 V) D - <?php endif; ?>
. W5 \! T& F2 j/ B0 I. P& f - <?php xiaohan_pagination($query_string); ?>
! A, ~0 \6 r$ s: B' G0 m% B - <div class="clear"></div>+ e1 P1 K Z8 {/ f3 |3 W
- </div><!-- #content -->. p1 `" X5 p4 ^' `4 K' ^
- <?php include_once("sidebar.php"); ?> F% l8 Z+ W9 g" r3 M% c P
- </div><!-- #container -->5 S. H/ `! ]& ]& v: ]
- <?php get_footer(); ?>
, p1 i# `/ F1 j$ w- S; n4 O
複製代碼 |
|