,我做的一個站,有個模板,為什麼首頁不顯示,是不是出現什麼問題的呢?我網站是:http://www.healthprotections.com
! {3 a! q: w Q J" ~' W; {: \
首頁代碼是:- <?php get_header(); ?>2 s6 E; [2 ?) U" d* r
m5 L! g1 w, S* o- <!-- content -->
' @7 \4 r+ q6 S+ l# [ - <div class="content">) D1 M3 \. M6 a8 Q' x
- ; g0 L% R/ \( _+ _4 J
- <?php if ( !function_exists('dynamic_sidebar')
1 Z9 a1 D! c# ?6 b - || !dynamic_sidebar('Ad Position 2') ) : ?>
! o$ p0 m* u m( T# |9 ` - <?php endif; ?>
& D7 `! ~2 o+ H -
& M* A! [0 f5 p& s5 s5 K - <!-- leftcontent -->. @% h' |- o' c5 W. X, |" N6 C
- <div class="<?php if ( substr(of_get_option('site_layout'),-1) == 'l' ) { echo 'leftcontent-l'; } else { echo 'leftcontent';}?>">
1 _( a8 ^4 N) V: \0 L - ( X4 O& T4 p( `, |2 Z
- <?php if ( !function_exists('dynamic_sidebar')6 j# f2 V7 t' A3 ~1 M+ v: ]$ D2 x" o
- || !dynamic_sidebar('Ad Position 3') ) : ?>
& s( A$ D( Q# J! F# i9 V - <?php endif; ?>5 e/ R2 |" E0 p( Q5 w* f. L
-
1 o+ k2 u0 x; { - <?php if ( of_get_option('homeheading') <> "" ) { ?>
& o t7 |) q2 Y8 U, _ - <h1 class="postmargin"><?php echo of_get_option('homeheading'); ?></h1>
5 ?5 p# m6 P" P% Y$ K, _ - <?php } ?> N! Z5 z: B0 \/ n8 B, o i
- 5 k- P6 m7 L# R1 w% p
- <?php if ( of_get_option('homeintro') <> "" ) { ?>1 A9 `* {5 l* K+ I, w! F
- <div class="intro">. [, Z# I5 G( M* `0 \
- . R$ W6 B( _( D& ]/ x
- <?php if ( !function_exists('dynamic_sidebar')8 A5 U3 S4 C; ]
- || !dynamic_sidebar('Ad Position 5') ) : ?> T* D0 y9 u# ]% S2 q3 D$ R
- <?php endif; ?>
# ]; [# M0 x8 M0 G8 d -
1 b( L0 W6 p/ l - <?php if ( !function_exists('dynamic_sidebar')
# `$ w! B& d, c" F2 M0 G - || !dynamic_sidebar('Ad Position 6') ) : ?>( Z7 X" l! x7 X6 @! {; @7 Q
- <?php endif; ?>9 o- t3 \( ~/ P+ } `9 v
- 5 O+ j4 x: A% @, Z
- <?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 } ?>/ g9 ?7 i6 M6 N. D
- <?php echo stripslashes(of_get_option('homeintro')); ?>
4 h. I& U" T! @) P: E' A p* v8 w- \. B - </div>
- Q4 c# _3 i% b% M$ Z. q7 j2 a - <?php } ?>
* t% @' g5 ~: r" u' y( y - ' w |+ s4 z. C0 Q
- <?php if ( !function_exists('dynamic_sidebar')
* D& I4 s: s0 E1 i+ M1 H - || !dynamic_sidebar('Ad Position 7') ) : ?>' A( `$ \- G6 _- H: V
- <?php endif; ?>3 _6 y7 O4 t2 E7 B9 O) j
-
# x8 A6 S: L+ n, x4 Y; B - <?php if ( of_get_option('show_home_posts')) { ?>+ H7 T& k/ ~3 m6 @; _. Q
- # L4 E& I. \ k, i$ }* \ Y5 c
- <?php if ( of_get_option('categories_home') <> "" || of_get_option('home_posts') ) { ?>, e) |: v& R5 Q4 y
- <?php $cattoinclude = of_get_option('categories_home'); ?>4 A) q1 A" c! j( Q1 h: E1 _
- <?php $homepostnumber = of_get_option('home_posts'); ?>
2 a K! m! e3 F# p) s8 c& b6 g9 B - <?php query_posts('cat='.$cattoinclude.'&showposts='.$homepostnumber); ?>
# o u) K0 l! _- x: L; n: n - <?php } ?>& z) R/ T% m) L7 ]. H1 H
- ; f0 u# l ~& Q( m1 d! q
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>) ?: X( g& v: [6 y- l: {9 \
-
9 Y% M" i @$ F1 c+ U) w - <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'med-thumb' ); ?>
$ ]. j: ?9 f8 \ E. b7 b2 ? - <?php if ($image): ?>' e9 H6 k( Z9 a0 a7 N2 @* ^) |
- 6 p' V$ O# m" X" c
- <!-- post -->9 Z! v) T' a0 g! S7 Z
- <div class="post">" x1 R; p( o( F6 j' j. X7 V5 e
- + d7 W9 B& W/ d7 M1 B d
- <?php if ( of_get_option('home_excerpt')) { ?>9 w& z8 S7 c% W: ~7 n7 v7 Z
-
( V. s) W& ?9 a# u( ? - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>; u% ^" j, l: P" T+ o2 s
- <?php if ( of_get_option('showmeta')) { ?>4 a$ t7 z( M3 d x, W
- <div class="post_meta">
% \2 Q8 t# \# S" v9 W! ~ - <ul>/ p7 N. R- w9 S+ W8 [' [
- <li><?php the_time('M d, Y'); ?></li>$ W0 r. ~+ y- y
- <li>|</li>
) _# w, U) P8 i: u! J. c; k( p - <li><?php the_category(', '); ?></li>! j! p2 n* m! p* j+ w* f' @# k* c
- <li>|</li>
( |& I3 {9 r+ ]( M; \4 i( _8 L" R - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>1 m; I! {8 q8 ^: l, X& J& P: T: h
- </ul>
) U* b' Q3 l# |6 J+ y* ?; Q9 d$ d - </div>5 c$ y9 M1 I% b% T s
- <?php } ?>
0 U- O' ^- Q+ j' ^0 Q# i - <div class="postleft">1 \9 ]6 ^# a; U, c: N
- <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>
, I: }( g$ q3 b7 Q - </div>
3 i4 k- y+ w! W3 E" p - 8 B0 H3 y3 E) p/ @5 h3 f' A' \
- <div class="postright">: |( A3 w6 }; D
- <p><?php excerpt('200'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
) t: C/ r) M) j: Y; J4 M# y - </div>2 n5 {: ?4 `7 y1 }/ h- B
-
2 G# U U7 L- I9 m3 q - <div class="clear"></div># v& v: P! u, Y8 [
-
8 f2 s8 h) z5 {( \7 k - <?php } else { ?>8 X2 X5 `4 E ~4 ?2 m! _4 ~
-
- l0 q! U5 `* G6 E7 _* Q - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
2 h4 P0 A# k. c" i - <?php if ( of_get_option('showmeta')) { ?>
: @& m$ M! i' l! K- P+ b N9 G - <div class="post_meta">
* F3 `: N- \& D2 c' I$ a - <ul>
: w" S, b- U8 O- X; u2 n( O - <li><?php the_time('M d, Y'); ?></li>+ S: ^; a& D6 D# y0 T5 V5 @
- <li>|</li>" T: k7 i- Z7 u
- <li><?php the_category(', '); ?></li>, `$ k+ C9 p6 s0 B7 R
- <li>|</li>3 s" F; b7 Z" [9 i3 j ~
- <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
7 }$ r, h0 N2 E/ h: I& o - </ul>
# J0 u& S0 f! g0 j4 y' X c - </div>+ V& X" I. T( s% Q- V
- <?php } ?>
; g0 `$ I; y4 ^( V' U' A - + o2 l3 b) G1 {& r$ G2 i
- <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>
7 _* V% i, f2 ?% i - * m8 u8 l/ W z" Q5 z. p
- <div class="clear"></div>4 S* p* m! Z }5 H
-
) N( s8 O7 w! m - <?php } ?>
; a/ O4 [0 l" P5 C* |2 G: o% d' |8 o4 n -
6 M! S# f1 j* C& r' T; D - </div>
4 |3 W! f9 i* ~3 F! A. K5 Z - <!-- end post -->
8 c: J* o/ W, h6 Y5 K& K -
; K6 e1 u2 d6 m' M - <?php else: ?>
* E# h( X) D1 V* J' b' F& \ -
$ ^3 I+ F8 S$ {: T2 j; ~* c - <!-- post -->0 V* W$ d" s: B. Z
- <div class="post">
( e& X) E) ?& u -
5 s" D6 Y1 n5 ~1 C, E - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
( o* P0 q2 [+ E. D# [1 R - <?php if ( of_get_option('showmeta')) { ?>, H/ Z' C- Z# K: P4 R5 h( e
- <div class="post_meta">
& n3 r* C0 R9 R# [# h - <ul>8 K- A% _0 P& Y: o# c1 V* Y3 y
- <li><?php the_time('M d, Y'); ?></li>
7 k0 U N$ a0 Y3 N3 I3 Z8 o/ w - <li>|</li>2 i4 v5 ?+ x1 c1 D$ K( v2 C
- <li><?php the_category(', '); ?></li>; j. ]4 P* b0 Q* X& r& C; W( p
- <li>|</li>" p" k3 z5 T. ~* T; B
- <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>* Y# [# g6 R) I* ^4 X9 ?/ e
- </ul>
& N, p( u' C( ? - </div>
0 ?" g& Q+ {+ o9 X$ Y' i, m5 M, }% j - <?php } ?>$ V! b8 N1 r. Q1 d
- <?php if ( of_get_option('home_excerpt')) { ?>: S) |% T, e$ b, ]* _- D6 o
- <p><?php excerpt('300'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
' s& \" n" e p" Q- n- u: u - <?php } else { ?>! h6 f/ {* @1 ]0 x
- <p><?php the_content(); ?></p>: ^( T1 z" t5 s% n; G
- <?php } ?>
* M$ `0 {, E# {+ V: v: o - 9 Z! \' n4 n# g0 H8 W9 @, R+ a
- </div>
1 y1 I& w4 i" ] - <!-- end post -->. p1 l4 h9 L# J' ^+ F: U7 p
- - @7 `( s& t+ N2 p' D
- <?php endif; ?># \& J) e3 r; I8 G6 W
-
* `3 z8 J- h0 f- }. { - <?php endwhile; endif; ?>2 Y6 |* P2 ?5 x% M, b; Q6 k
-
$ { x1 [7 M( g" @) z - <?php } ?>
4 m, m% d- a9 z6 k+ A - 8 h) x0 X7 i" ?9 z% z
- <?php if ( !function_exists('dynamic_sidebar')1 V! j; n# I2 c3 I2 l& F1 `/ e
- || !dynamic_sidebar('Ad Position 8') ) : ?>
" O; O/ u/ p+ z3 |# E - <?php endif; ?>: I* i, L, t8 r6 p0 ]. }5 d
- 8 E. e+ r V1 h( V! w: O
- </div>4 t0 O7 z& r. w" W
- <!-- end leftcontent -->
6 ~% s$ \" S: Q( b9 }* F - " ]* F' Y, U5 m7 _8 l3 O$ ?
- <?php if(of_get_option('site_layout') == '3c-l' || of_get_option('site_layout') == '3c-r'){ ?>; D6 J" K. H& H8 F! Y! C
- <div class="midcontent">
. A# @* R5 U y+ M2 u8 A8 S3 V - <?php if ( !function_exists('dynamic_sidebar')
L: a+ {- f8 l6 ?: s, m - || !dynamic_sidebar('Middle Column') ) : ?>
0 l; p8 j" p# W' r3 j9 n - <?php endif; ?>
1 Q2 v% F- [6 |" c3 {0 n( ] - </div>
$ _) s0 v1 [7 M8 \* M2 V: q - <?php } ?>
3 G6 c+ N- {/ D8 S; J -
% d& H2 |: n1 ^9 q* |7 f; a$ g - <?php get_footer(); ?>
複製代碼 這個代碼是不是有什麼問題?應該怎麼修改的呢?
3 s3 b0 q3 ^& T |