,我做的一個站,有個模板,為什麼首頁不顯示,是不是出現什麼問題的呢?我網站是:http://www.healthprotections.com7 R- C( ?& M) H0 F
" a' y6 s3 m' U; O/ m- V' p( L首頁代碼是:- <?php get_header(); ?>: v2 ?6 R# n& R4 G1 [" D, P
3 d [2 p9 U! _- <!-- content -->) U1 F7 m: z( X0 h
- <div class="content">
. a/ i$ P+ {4 ~, @ |+ q- f -
! X# G8 ]" `" U, g# U( _, v8 q - <?php if ( !function_exists('dynamic_sidebar'), j3 i5 P9 s+ u7 ?0 I7 ~4 @
- || !dynamic_sidebar('Ad Position 2') ) : ?>
5 r `9 o/ s; t - <?php endif; ?>
) O5 u( n4 o1 K# \' G1 C - ; R) X6 z2 |" {
- <!-- leftcontent -->
3 Y4 T* ~; g; n - <div class="<?php if ( substr(of_get_option('site_layout'),-1) == 'l' ) { echo 'leftcontent-l'; } else { echo 'leftcontent';}?>"># o) {& }. d5 Z- x2 K9 o3 ?
- # W) v# ^( |# {& b" }0 |9 i; ]
- <?php if ( !function_exists('dynamic_sidebar')
/ o. E& C5 B) n! I - || !dynamic_sidebar('Ad Position 3') ) : ?>
4 u8 Y$ y* p4 @; w' E2 A* } - <?php endif; ?>" e' c' U, }9 V6 C1 F u
-
" b- e7 ?( Z+ r0 U. L - <?php if ( of_get_option('homeheading') <> "" ) { ?>
* M+ Y/ {1 ^. H' O5 \- _" i" v - <h1 class="postmargin"><?php echo of_get_option('homeheading'); ?></h1>
! }9 A. m: E; I - <?php } ?>9 d) ^- S5 t5 z5 W& Z
- 6 W; \4 g3 W! i' Z1 ?4 ?+ ^# R
- <?php if ( of_get_option('homeintro') <> "" ) { ?>
6 s. A% f# ~) M& B) G - <div class="intro">
0 x7 }2 M" ~, [1 l -
1 ]3 O" e0 N0 C. _0 `* T - <?php if ( !function_exists('dynamic_sidebar')0 M: i8 v# f1 G1 ^) W
- || !dynamic_sidebar('Ad Position 5') ) : ?>. s/ v" d" T7 T
- <?php endif; ?>+ M" o6 J$ i& u7 ]
- 7 ]( l- a# l6 Y2 z
- <?php if ( !function_exists('dynamic_sidebar')8 D) t% q$ R# g7 G% g+ N& K+ U
- || !dynamic_sidebar('Ad Position 6') ) : ?>
, U& `1 Z5 l5 h" i% m - <?php endif; ?>
" ?6 N: i' V9 p A# D( M# W -
1 [3 d# B% E. 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 } ?>4 J( J Z& Q$ H4 m0 c
- <?php echo stripslashes(of_get_option('homeintro')); ?>5 w$ {' s" x% V$ t6 v2 Q
- </div>. X2 M$ t* w0 ~) V$ P X
- <?php } ?>9 P K1 R* X6 L+ U9 _9 h
-
/ Q, G1 r1 L# l0 b; y - <?php if ( !function_exists('dynamic_sidebar')% y+ J e2 p, X" K* @+ @$ H
- || !dynamic_sidebar('Ad Position 7') ) : ?>- Z$ M6 Y+ a2 A3 H6 N( E& s
- <?php endif; ?>, K4 j3 W' K4 F7 M- B1 a# M; h
- # a* R: Y' N6 l$ {! s+ l
- <?php if ( of_get_option('show_home_posts')) { ?>3 H N' L) z/ Q( U9 F& t
- : G8 q; K V3 P2 P5 j
- <?php if ( of_get_option('categories_home') <> "" || of_get_option('home_posts') ) { ?>
5 q3 X l j; U - <?php $cattoinclude = of_get_option('categories_home'); ?>" N2 n# p, b0 c" E7 h( F9 _! v. @
- <?php $homepostnumber = of_get_option('home_posts'); ?>) W, A: Y- P7 b, ~2 Q& {# Z4 m3 {+ T* v
- <?php query_posts('cat='.$cattoinclude.'&showposts='.$homepostnumber); ?>
! u# v1 B$ A9 \1 @3 E - <?php } ?>
# |, q0 p# a4 k! u; Q1 F7 K -
9 b& p# b# D5 j6 _$ ? - <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
* z0 E8 e1 X0 s. \ - % w& p8 Q! u+ F. {5 Y
- <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'med-thumb' ); ?>
4 m; P' q* t9 ~( c - <?php if ($image): ?>
: b+ G9 w+ i8 j, p3 j+ D' H- u" h - 4 `- `6 k; ~0 r. O, V
- <!-- post -->
/ [/ {3 K1 I: D- a - <div class="post">
& M; N, A: C& ?3 z -
6 @" q) O$ x8 p$ S - <?php if ( of_get_option('home_excerpt')) { ?>; d% W1 X& R& Z U! P0 [
-
% J9 X3 @- }" Q: i9 ^) ] - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
/ h5 J. M+ Z, | F - <?php if ( of_get_option('showmeta')) { ?>
# F" c0 f# M$ _( @5 s" R - <div class="post_meta">
$ O9 N4 P+ G% D6 I8 d% A- r' M - <ul>
; p) R% _3 j8 Y' V" l - <li><?php the_time('M d, Y'); ?></li>9 Q. G L1 {/ y6 P
- <li>|</li>- x8 M9 x3 r3 q# Y7 X0 {6 |
- <li><?php the_category(', '); ?></li>
9 Y) W9 ]3 |' M0 q - <li>|</li>
2 E5 l6 q+ \; o: k - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
+ D& K$ f6 [# x' O J9 B - </ul>
; d. E% O! i% { - </div>+ B! ?5 Y, i& V, \- ~. q
- <?php } ?>
+ {" @9 ` O+ d p3 o; P: v% V7 N - <div class="postleft">
! J/ Y( L6 E6 H. i& V& G: ] - <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>- K+ C A% X, m/ V2 n6 \, h
- </div>
) e* j$ _# }# N' s7 L# I; e - , H& ?: k! m) h
- <div class="postright">
+ ~9 z9 p8 [) s6 i7 t- I5 p C - <p><?php excerpt('200'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>- A1 U: J0 _: a7 j" L
- </div>
( n3 J: J5 s2 v: K. \8 j1 _- t - # L4 L1 _/ g& @
- <div class="clear"></div>
8 v. E. s) P4 n9 v$ D -
4 L3 R; ?! D! b0 T - <?php } else { ?>
, m# e& |% D( V -
. N" ]6 w; h) b) ~( B( x: M# Q - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
% A+ S. o* u* S - <?php if ( of_get_option('showmeta')) { ?>% \8 F( G c3 ~1 o7 }
- <div class="post_meta">, O* ?! C9 ~8 `+ U5 V8 M& Z' O L9 a# b
- <ul>- R- R, A, B3 P* [3 U2 S1 r& }
- <li><?php the_time('M d, Y'); ?></li>
* X2 S/ i2 h/ r* y - <li>|</li>
# Z9 X- l; c5 I" {4 H; {4 Z) W# e - <li><?php the_category(', '); ?></li>' {2 Y7 p8 O* V
- <li>|</li>) U" n& m. R" Y, n. e. E7 o: G0 M# r
- <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
: t% P$ X3 v* s. C2 a- W2 H8 ^* J - </ul>
3 R8 S* n) k! `* i# j7 y4 ~ - </div>* e0 Y. x3 K: w) ?7 w) @
- <?php } ?>0 l1 A' @3 }- M+ i9 P3 i7 R4 L
-
: [6 c+ |' S1 R' o( \3 Z1 x. @# x - <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>
% a; c3 O. D3 G5 r. V/ Y1 F4 F6 W -
: o% l+ l3 j- V5 ~- R) ?. z - <div class="clear"></div>
' f/ M/ y7 M% m$ H, L- t -
* x' M6 E' K/ n M2 c - <?php } ?>9 z5 @, z8 J3 d, R; z% K. r
-
" {0 l _2 ~. Z$ s+ M3 w - </div>3 W% t0 ?3 N6 O/ u
- <!-- end post -->
. N8 p4 U3 X. R. F) y0 y1 @; @ - 5 w' ]( b/ H$ J$ X6 K, f, B, f
- <?php else: ?>
9 h# O8 [6 l! U% U% u - . j8 B7 R8 j& D b$ @& h: a
- <!-- post -->
5 |7 T, q/ O9 D - <div class="post">7 { U/ w8 }/ t
- 3 G4 D" q6 r& i
- <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>" a5 z( d% s9 y( H
- <?php if ( of_get_option('showmeta')) { ?>
& F! O) Y; K8 O - <div class="post_meta">( t. n7 j$ v! [. ?/ [6 r B
- <ul>3 g% ^) i1 _; @; R$ H8 B3 ^
- <li><?php the_time('M d, Y'); ?></li>4 \& G @* G* Q& _
- <li>|</li>
; f/ d1 Y6 H& _1 u0 U& O - <li><?php the_category(', '); ?></li>
0 L) o" }3 x8 L0 } G. w7 L - <li>|</li>
* b3 n! h- U2 `+ R9 w Q - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li> A/ m" V; D2 M4 U
- </ul>
1 K! r# B: {5 U/ P: y4 e& {2 V$ d - </div>5 K" T( Q1 k: \
- <?php } ?>/ M2 W9 m. Y% S/ {6 N
- <?php if ( of_get_option('home_excerpt')) { ?>
- m- G: v' R! g2 N - <p><?php excerpt('300'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
3 V* k: i* w/ _. ~" q - <?php } else { ?>
2 q. ^, }/ y: v) F7 A: d$ n8 g - <p><?php the_content(); ?></p>
' P/ O( c; d! U) X - <?php } ?>
7 ~0 k& I3 b) G - & L" b. V. D/ I$ v i4 R
- </div>
8 p8 o$ Z, B1 J7 B" x2 m - <!-- end post -->) q v4 {2 d" m
- : G5 I, w% \2 {
- <?php endif; ?>% _: K; C6 ~9 k0 B7 m! \
- / U I+ e5 r' `% S8 O# _" D, W
- <?php endwhile; endif; ?>
1 E5 M; ?+ [7 L -
1 U: L- r* Q! Y3 Y7 }* s - <?php } ?>- R. n$ ~( L4 v
- j% D1 T6 S1 e/ w# v( {
- <?php if ( !function_exists('dynamic_sidebar')7 t; r& f2 q' `. H: y' m
- || !dynamic_sidebar('Ad Position 8') ) : ?>- }7 j- q$ y/ \
- <?php endif; ?>
( m" P3 e8 y6 h - . F) q6 b, \! [5 X. g
- </div>
; q" x. i. B0 L - <!-- end leftcontent -->0 P' g7 o6 \$ A: `
- 9 z4 m) ^0 O# F5 k" Q: ^3 o6 s
- <?php if(of_get_option('site_layout') == '3c-l' || of_get_option('site_layout') == '3c-r'){ ?>' x( p0 i1 g/ |1 v
- <div class="midcontent">9 ~& T7 h! {" [( p% p0 x
- <?php if ( !function_exists('dynamic_sidebar')" X( A- F2 m+ E1 k7 s
- || !dynamic_sidebar('Middle Column') ) : ?>
9 q( b& V/ w* x) \: L - <?php endif; ?>
! F7 z$ f3 |( B3 t* ^( P - </div>
) h6 d$ s4 Y+ h7 n& f: R+ \- T- e - <?php } ?>
* ?' S) x+ l3 o& H1 ]. O - $ ^: m+ ~$ s) }8 h
- <?php get_footer(); ?>
複製代碼 這個代碼是不是有什麼問題?應該怎麼修改的呢?) x$ t Y9 P/ p! t- H
|