,我做的一個站,有個模板,為什麼首頁不顯示,是不是出現什麼問題的呢?我網站是:http://www.healthprotections.com
6 v" q2 j& q4 J+ X0 a8 s! d
- M a! }/ j E3 O! N$ C首頁代碼是:- <?php get_header(); ?>
& k" M3 k1 A) m0 X2 G) {- q - 4 j% y; \1 ?- A2 O5 v$ V( M1 }; u/ O
- <!-- content -->
5 \* B {6 V8 D2 ~ - <div class="content">
; ]5 y! I' C- x! g3 M' o& c - ! \) k x$ o- z8 B: v" w4 _7 E" _
- <?php if ( !function_exists('dynamic_sidebar')
$ t4 J" t4 H$ S$ C+ n - || !dynamic_sidebar('Ad Position 2') ) : ?>
0 P& \) d7 }+ Q2 j) x - <?php endif; ?>
: M) @- O4 c0 c6 L& u! a -
3 |$ R3 X8 l& H+ I w - <!-- leftcontent -->; }2 N3 \# B3 w t* R3 v' X
- <div class="<?php if ( substr(of_get_option('site_layout'),-1) == 'l' ) { echo 'leftcontent-l'; } else { echo 'leftcontent';}?>">
! m) o; O' S0 I5 H -
+ s& }! h( P# h: v) j( v- ^3 \ - <?php if ( !function_exists('dynamic_sidebar'). m; X2 e0 N. M; p" j% c" V* T
- || !dynamic_sidebar('Ad Position 3') ) : ?>) w/ e8 V/ d4 R
- <?php endif; ?>) C$ z4 P- m/ I/ \; z* `3 {! p0 q
-
* w+ Z) c$ }5 j; G - <?php if ( of_get_option('homeheading') <> "" ) { ?> ' v* `+ @& \9 f# B4 h
- <h1 class="postmargin"><?php echo of_get_option('homeheading'); ?></h1>, L7 }4 }: D/ I; I2 q; Q7 {5 L
- <?php } ?>
. e# f4 s" i1 a, y% I5 H/ w
, [, t& c% X/ Q5 y3 l/ g0 ?- <?php if ( of_get_option('homeintro') <> "" ) { ?>
$ f4 Z: @) O' P6 L+ ~ h - <div class="intro">+ C9 C. f. L: e C7 y
-
0 d& @8 Y M" x& p8 m0 N: Q# {! a( T - <?php if ( !function_exists('dynamic_sidebar')
8 e6 w- }' ~" l: }9 b% S$ Q2 v) @ - || !dynamic_sidebar('Ad Position 5') ) : ?>( g3 {( E" x# o5 Q1 k7 N
- <?php endif; ?>$ I0 O! d& x: |+ s& q' U
-
, g8 y) T! H) R - <?php if ( !function_exists('dynamic_sidebar')6 [4 G$ r; f2 {: I
- || !dynamic_sidebar('Ad Position 6') ) : ?># G5 C' {, R, K% M$ c3 @; o4 x
- <?php endif; ?>
' ~6 F2 @4 t H! N -
/ N% ]5 v3 v; c% `5 [' ^$ L8 @9 x; S - <?php if ( of_get_option('intro_image') <> "" ) { ?><?php if ( of_get_option('intro_image_url') <> "" ) { ?><a href="<?php echo of_get_option('intro_image_url'); ?>" rel="nofollow" target="_blank"><?php } ?><img src="<?php echo of_get_option('intro_image'); ?>" align="left" class="introimage" alt="<?php if(of_get_option('intro_image_alt')){ ?><?php echo of_get_option('intro_image_alt'); ?><?php } else { ?><?php bloginfo('name'); ?><?php } ?>"><?php if ( of_get_option('intro_image_url') <> "" ) { ?></a><?php } ?><?php } ?>. m5 z) t. n9 q* ?4 @. O, u! P$ E
- <?php echo stripslashes(of_get_option('homeintro')); ?>
8 d# A& a- C% h - </div>
& G- C* j% Q" `- _ - <?php } ?>
$ S" ^% Z0 I& [3 `( j -
" g* W6 P9 s' t4 Z# G. l9 W* w( u" @ - <?php if ( !function_exists('dynamic_sidebar')% g8 g, i5 l- } |$ k
- || !dynamic_sidebar('Ad Position 7') ) : ?>/ R, U9 g/ \+ b9 R: S. T+ O
- <?php endif; ?>6 k0 E* V( O- |$ T* E/ }2 ^7 ]
-
1 ~7 k* O8 T! [/ \* ?! F, N/ q - <?php if ( of_get_option('show_home_posts')) { ?>! B3 `" }& z7 o' S6 }5 I8 p8 |4 m
-
# ~: ]0 ?( h1 z9 p6 F. x% P6 ]' g$ O - <?php if ( of_get_option('categories_home') <> "" || of_get_option('home_posts') ) { ?>7 l. H+ z5 a. Z: P6 y6 j/ A' w$ ?
- <?php $cattoinclude = of_get_option('categories_home'); ?>
0 T2 |( V% ~" V' |$ H8 T3 b - <?php $homepostnumber = of_get_option('home_posts'); ?>5 k; f$ e! Y1 \
- <?php query_posts('cat='.$cattoinclude.'&showposts='.$homepostnumber); ?>( u2 s1 q( X* M+ V% j, r
- <?php } ?>& E; Y' |# B0 T
- " l- O' T8 H% k- O% y3 [0 R
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>! l2 R, b1 _2 n1 Z3 v T
-
9 F# E; x& }3 A5 V7 j - <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'med-thumb' ); ?>
, f3 S8 Y$ R" q" K! e: K" W% m - <?php if ($image): ?>* I9 Z% e- q% K% e, S6 O! I
- 3 N# u1 b- [4 I! |6 {% C
- <!-- post -->8 Z2 T6 i' |/ W: A j
- <div class="post">' l3 n7 {* `: | s" F
- 9 N: e" S$ _1 }. k
- <?php if ( of_get_option('home_excerpt')) { ?>7 M( `# t" L8 N6 E+ M. k. z* t
- + w/ m, }# M6 U! i* ^8 D
- <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>) z9 D5 Y2 v2 }8 L: [1 r [, w
- <?php if ( of_get_option('showmeta')) { ?>
% |6 m, l7 |! K - <div class="post_meta">
, D Y8 N5 L D! P. B4 C$ E/ Q4 } - <ul>* K* Q9 V( E- s8 M
- <li><?php the_time('M d, Y'); ?></li>
1 i+ ^+ U3 m5 j$ V( `! o( Q3 E - <li>|</li>
" O2 I! i0 Z# t! L, O; N1 h - <li><?php the_category(', '); ?></li>
9 `4 K" ~% D* G* c - <li>|</li>: Y; H h8 A0 s3 d* @+ M W
- <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
$ M( M$ a7 e8 |5 L2 l Q) J* ?0 q - </ul>) t2 Q2 W: Y) a; i! d# X
- </div>
1 U) n6 A4 P5 i# I: ` - <?php } ?>
: c( s: z' P( e+ s: M - <div class="postleft">
, ~( T9 ^! p6 Y0 f: V. s. m - <a href="<?php the_permalink(); ?>"><img src="<?php echo $image[0]; ?>" width="150" height="150" border="0" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" /></a>
2 _9 s8 ?* s, f( _& Q$ a - </div>% J' ^2 u& h0 R
- 0 j- u2 q# r$ {. a2 ~: o
- <div class="postright">% {5 y( {5 M% Q+ I8 x: ^5 V
- <p><?php excerpt('200'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
; B7 ^% Q" B$ N' q - </div>/ o( _" R4 o" |* b0 ?
- ; c0 x% ~6 N% M( |3 }* w
- <div class="clear"></div>0 F8 K* Q# D: m2 U1 O
-
- y, m* Y( F: c5 S5 ^' m - <?php } else { ?>
( b, l- Q5 S+ p8 f7 v' G - ' g9 Q: x% \7 k7 \: i3 q
- <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
( S" p G8 X* ~4 T2 o - <?php if ( of_get_option('showmeta')) { ?>
1 p' P0 C6 H7 J; W! \( V% w% i% _( R8 M - <div class="post_meta">
. U% I' w6 k6 L! w- D9 `& { - <ul>
) L. E5 N( M; h - <li><?php the_time('M d, Y'); ?></li>) E" c! Q& f8 s, {0 c
- <li>|</li>0 z- z# L% H- X0 G: W
- <li><?php the_category(', '); ?></li>
9 Y( ?; ?' o; k2 c0 x8 D. O6 h& J - <li>|</li>
( a) [1 v" k/ b/ f* A/ N - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
" E! a! }: g0 ]4 Y$ T; c& u - </ul>
5 g! f5 ^2 X3 G' J/ V/ e9 j3 o+ M2 A - </div>
( G5 Z* C2 |/ ^+ q& T - <?php } ?>9 w8 C* s7 B) p& D( q
- # x- u+ T% ~, @$ V
- <p><a href="<?php the_permalink(); ?>"><img src="<?php echo $image[0]; ?>" width="150" height="150" border="0" title="<?php the_title(); ?>" alt="<?php the_title(); ?>" align="left" class="fullconentimg" /></a><?php the_content(); ?></p>( ~ X% Z1 h6 Y( Q; Q
- 8 f- u: |" K3 Z* }- i
- <div class="clear"></div>0 I$ w2 ~0 `0 H7 m' P6 w* T
- + d6 |, ~' f+ Z& o1 E
- <?php } ?>
" ?4 w; X% s1 w8 p& ]# v6 g% i d -
0 C, i9 s, i9 x& _" P - </div>. W" \/ ]: p2 C# Z# q ^2 V4 [
- <!-- end post -->& A6 ^3 F! @9 m
-
l2 R4 E9 r; T5 r - <?php else: ?>
" w' |+ t5 J1 W. z% j0 ^ - ! r( k8 ~4 b% d" m4 T1 ?
- <!-- post -->/ Z3 H" U; \# C1 T* ?) M7 r( c
- <div class="post">6 \8 S+ A( ]4 {# `/ s% P& Q7 k
- . K5 F) ]4 t$ j: p
- <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>$ Z; s) {, E9 }. E. b* j
- <?php if ( of_get_option('showmeta')) { ?>/ ~; q: E: l( x* o
- <div class="post_meta">3 j% }7 H s8 s/ z! m! N
- <ul>
6 h. I" E/ L l: t - <li><?php the_time('M d, Y'); ?></li>5 _% s3 X1 I7 O+ d+ H1 h, v
- <li>|</li>3 i4 I& c# m8 W( }1 f i
- <li><?php the_category(', '); ?></li>
8 C f F1 ]/ ?0 o# h7 |4 ?; x - <li>|</li>
- `+ I5 p/ H: i8 k7 j - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
3 f8 p" [+ V1 W, l - </ul>
3 V7 p4 N( }# G - </div>+ g( K2 M' H7 M7 Z
- <?php } ?> B$ D9 x: }0 y% b9 @ l& ]
- <?php if ( of_get_option('home_excerpt')) { ?>7 W2 U' q3 H# E t
- <p><?php excerpt('300'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
! P \" L0 M" W# ~" p' B0 P* Y* D4 k+ I - <?php } else { ?>
+ J5 L, \( s. s# n - <p><?php the_content(); ?></p>4 h }' y* O8 t# {) v! z
- <?php } ?>! M4 [# q0 j9 F( e
- 7 d) e+ |1 b/ J& w1 W0 V: q
- </div># D1 O% Q* l; U! a/ S# V
- <!-- end post -->2 ?; }, T* K& N1 A( j
- ( Q, `; {6 N* C- h
- <?php endif; ?>/ l% j) s) M4 s2 D
- + I# D w% O! c' I* o! r ~0 n
- <?php endwhile; endif; ?>2 W, m q9 f7 n$ V, w# B
-
& T- s0 M) [) b- R' v - <?php } ?>% h+ D' q+ I U; R. ?4 g; f
-
Z! l/ i# P: v. S$ r - <?php if ( !function_exists('dynamic_sidebar')- |$ h) M9 u; s h; k
- || !dynamic_sidebar('Ad Position 8') ) : ?>2 a- _( g; g% P/ h) ?( G* t5 s
- <?php endif; ?>7 I+ r& y' b6 o+ [5 A7 _5 j
-
& j2 u5 z7 @+ G8 E7 M - </div>
$ V* X# ]' `! J9 a% g6 d9 N U, s - <!-- end leftcontent -->
: _$ ]8 t1 J7 {6 c& A4 p9 I - . h2 @6 o$ }4 x, A N4 [9 W
- <?php if(of_get_option('site_layout') == '3c-l' || of_get_option('site_layout') == '3c-r'){ ?>+ K5 @' N$ }/ h0 k
- <div class="midcontent">
, e# j& V2 e( h) W9 i2 C7 H G5 ? - <?php if ( !function_exists('dynamic_sidebar')
) a4 G: ~ u, P - || !dynamic_sidebar('Middle Column') ) : ?>, W% f& j+ Y! x
- <?php endif; ?>- i3 b# T" n* F1 g- q! X
- </div>
; q' @. o2 u3 [& g - <?php } ?>
@6 ^, L: o" h' T, C/ r -
$ s/ N& s, i# y: ]2 K q) Q* } - <?php get_footer(); ?>
複製代碼 這個代碼是不是有什麼問題?應該怎麼修改的呢?
8 r G( e( C) t0 K& F5 N6 T+ V |