,我做的一個站,有個模板,為什麼首頁不顯示,是不是出現什麼問題的呢?我網站是:http://www.healthprotections.com$ t( n0 X* Y& Y k5 H
2 b& ~9 d. s2 v& }1 _ a2 e
首頁代碼是:- <?php get_header(); ?>- K# G; n7 x5 o1 W6 G) y% Q
3 M/ Y, A2 c& J4 B$ g" V- <!-- content -->. t& n6 `3 u4 \0 L, ]5 s; T: O
- <div class="content">3 Y0 z* ?: ?; e' ~* a) F. ~3 i
-
5 X) ^2 j( F1 U) H9 h* v - <?php if ( !function_exists('dynamic_sidebar')
6 D) W- N, V* _' U0 j - || !dynamic_sidebar('Ad Position 2') ) : ?>7 j' M( P% |9 @0 g8 x. @5 ~& h# i
- <?php endif; ?>
, `% T7 q _) `: ~, [5 S -
8 a- u( g1 ?& f: @& P - <!-- leftcontent -->/ S' _7 l1 x7 R7 m) k
- <div class="<?php if ( substr(of_get_option('site_layout'),-1) == 'l' ) { echo 'leftcontent-l'; } else { echo 'leftcontent';}?>">2 x, @- J0 [8 o b2 c0 M4 }/ N" w X
- ( j# u# t% I) u$ h: q6 r# n
- <?php if ( !function_exists('dynamic_sidebar')6 J [/ E2 B, K5 {0 v
- || !dynamic_sidebar('Ad Position 3') ) : ?>
. U2 ~8 i% r& ?9 J5 x - <?php endif; ?>' D0 b" ?5 J2 n8 b, J( S+ e7 t) Y1 \
-
( c- X+ t0 m% V; i2 l) f - <?php if ( of_get_option('homeheading') <> "" ) { ?>
5 a8 }* S. q2 x, n, _+ t - <h1 class="postmargin"><?php echo of_get_option('homeheading'); ?></h1>
. K8 D0 `5 p# A, T - <?php } ?>
2 K: a6 x7 B% c( l) E
' V2 _3 B9 X* N/ j- <?php if ( of_get_option('homeintro') <> "" ) { ?>
/ B' u/ P# H/ m7 p, M* v - <div class="intro">
3 M# V* x- `/ `9 F, h# g# t7 w -
/ e5 j7 S$ o: e' x W) O - <?php if ( !function_exists('dynamic_sidebar')/ R1 F$ S/ }: h
- || !dynamic_sidebar('Ad Position 5') ) : ?>" T2 n' I3 Y: R& A' E) Y
- <?php endif; ?>
) `, S0 o( p0 M* h! F9 R& u0 k -
3 @ V5 ^3 S) _7 Y" Z7 ] k - <?php if ( !function_exists('dynamic_sidebar')5 {/ `: P' I$ A+ A, i4 u; ?, \
- || !dynamic_sidebar('Ad Position 6') ) : ?>
* W+ F6 x6 H! Q. P# N5 N6 {1 ^* x - <?php endif; ?>
, `! v# i2 N- r: B/ _ G) L - + b% e3 m r& l4 R3 d. E
- <?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 } ?>3 M d% W4 U2 ?7 o; S! E1 j
- <?php echo stripslashes(of_get_option('homeintro')); ?>
6 r$ `/ a8 R% v& s$ P: k6 Z - </div>
- ^8 z9 ^+ j8 u8 v - <?php } ?>
7 \; [) Z4 ^7 {! s5 q - % ~5 q- [: \" c
- <?php if ( !function_exists('dynamic_sidebar')
z W0 D. L+ o/ v6 { - || !dynamic_sidebar('Ad Position 7') ) : ?>
3 P0 _ l% [, o0 Z9 d - <?php endif; ?>* ~& k {6 u" M2 h2 c
-
. B# c1 f/ I4 l, o - <?php if ( of_get_option('show_home_posts')) { ?>
1 r% L5 j# J$ u4 r" o - " d6 M, @3 o- ]9 u1 O: T" d
- <?php if ( of_get_option('categories_home') <> "" || of_get_option('home_posts') ) { ?>
- O% f9 q6 U& a - <?php $cattoinclude = of_get_option('categories_home'); ?>
; d& K4 h/ Y& X& j# e - <?php $homepostnumber = of_get_option('home_posts'); ?>* H) O9 s9 _& N: o& R' r
- <?php query_posts('cat='.$cattoinclude.'&showposts='.$homepostnumber); ?>, a" \0 W3 P6 S* m/ a0 T
- <?php } ?>3 T$ l }% X3 D6 [
-
# ~9 F" V6 K: {1 z" b - <?php if (have_posts()) : while (have_posts()) : the_post(); ?>, d* d8 L+ n' A2 S( q1 H; H
- ( L, \8 J; y/ A) ~$ p2 E
- <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'med-thumb' ); ?>1 a& \9 k1 g9 @% Y4 c* T( e4 X1 Q9 @( f7 s
- <?php if ($image): ?>
* f3 ?# T: P( d8 @7 e* R- T' }' e -
2 p7 R6 `0 o+ ]: e - <!-- post -->
4 I# g& ?; Y" e7 w1 x6 ~9 Q5 c2 B9 | - <div class="post">" I! B- Z# F$ K4 ]7 H6 g
- 1 C' @* `: [" s1 a
- <?php if ( of_get_option('home_excerpt')) { ?>
) H* a' o: v4 ?" T+ x5 | -
/ x2 ~9 O4 \( F/ @) |1 A - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
5 _4 i0 R) `+ \+ I3 x3 v, ^ - <?php if ( of_get_option('showmeta')) { ?>% C X: F% z0 Q- O5 M
- <div class="post_meta">; P' v) [3 N l. C
- <ul>) N6 a* i3 V0 p/ y2 y7 ]( {1 L
- <li><?php the_time('M d, Y'); ?></li>
* ~7 o# G) a# [$ L3 D6 ]/ Q - <li>|</li>
- ^; H7 O+ B3 t* |' l& R - <li><?php the_category(', '); ?></li>0 C+ f: ], e, d$ b( ~
- <li>|</li>
4 S) ?" C2 n2 o7 U5 c0 [ - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>& ?- B3 x4 {# S+ W5 ~1 ^
- </ul>
! o' Q% w" r; t8 |8 y4 D, d - </div>7 ]) p7 J% Q6 V# h
- <?php } ?>0 m+ l O# |4 p* Q7 i
- <div class="postleft">
& p! A; g1 s8 B0 Y, V$ W2 ] - <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 z$ c' g' M4 O+ P6 j - </div>" [# C2 H& U8 l1 r2 s
- 0 g$ f) m# u9 b+ ~6 R/ K; c& W q: _
- <div class="postright">
+ ~% e" h" `( R" e2 m! D - <p><?php excerpt('200'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
* j/ t" D/ b. t2 G$ S - </div>
& g. Q- J3 Z8 p) a8 V% g: s4 N. I - $ Y3 F# T1 ^/ P+ ^1 f- t
- <div class="clear"></div>- ~4 x' d$ C0 s; i" ]0 D
- 2 _! l$ Y" e9 p) E& X, G
- <?php } else { ?>! x: K( v8 P2 j! {
-
7 o( o7 Y# A# W8 o2 V V - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>% h2 _, I' g L
- <?php if ( of_get_option('showmeta')) { ?>0 G6 f% x+ c6 G4 d- ~" m
- <div class="post_meta">
* S9 \2 g4 r( S3 q D% G, d - <ul>
- N& j" o/ q$ Z; f - <li><?php the_time('M d, Y'); ?></li>
5 O/ \* L* m& F% n- c" y/ Z - <li>|</li>
+ V5 J) L9 ~4 i- W. M - <li><?php the_category(', '); ?></li>
* A; [" y* j3 t9 p. j& Y - <li>|</li>
( I9 W! {3 c8 ~% N+ Y2 }. S/ [$ F - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
9 \: V4 b0 X( B) x5 y4 z2 V - </ul>5 o3 n: G. O4 H. v: T
- </div>
9 S& m% b( q/ l/ U0 J5 ^2 w- X7 ?, a - <?php } ?>
2 i2 K4 U# H" i% Z2 s: K, }0 _" [- { - 7 w1 D- Z! |4 z0 c
- <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>" C# }# o. y& ?( d0 p
- + M# ~ F! |4 r Z* a
- <div class="clear"></div>' L0 Y b: Y$ M/ [8 l% _3 `- e& i
-
$ _9 z2 t1 Y/ l& c5 b: s7 K - <?php } ?>
; |! g5 p0 S0 b9 t0 r- l -
( D) i, E0 A4 u$ P. l# }2 p - </div>3 x$ c7 y4 s/ G
- <!-- end post -->2 p; ]" i; j' @6 g
-
7 d* s. h& _* a t: k ^. i - <?php else: ?>( }' @) K! U3 `8 N2 W/ c. e
-
5 | C9 |0 f6 o - <!-- post -->
" Z) d. X* q$ K8 C/ O, } - <div class="post">9 P( d5 j* ~; W2 F O
-
5 V/ P: S! h" N. F* W$ L: [ - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> {0 }+ s1 e5 Y6 Z; \% t
- <?php if ( of_get_option('showmeta')) { ?>5 D; ~ G: D' I3 i
- <div class="post_meta">
" n1 ]: T* s5 a& @ - <ul>
p6 c9 o( f9 n; O - <li><?php the_time('M d, Y'); ?></li>
! Q1 k+ b- q! r8 l8 N - <li>|</li>) `- A( H2 v0 P. T
- <li><?php the_category(', '); ?></li>$ L2 o8 P+ C U6 I4 u; d& y
- <li>|</li>
& N/ u( a z( v$ P' ^, D - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
& v) @+ l7 m6 C& b, B6 i: M, T - </ul>" ~; e1 }4 J1 v0 ?9 L1 U
- </div>
' M0 c2 i! ~' O- a/ |( M/ E8 n0 \ - <?php } ?>' J; C# `+ ?1 l$ u" u) d
- <?php if ( of_get_option('home_excerpt')) { ?>
2 N0 Y, P* F/ X+ m) r$ Q; S4 @ - <p><?php excerpt('300'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
" K6 d8 {+ L$ x& u" ?& c* Y( r7 q4 S - <?php } else { ?>
+ \8 p' j" G, l: d - <p><?php the_content(); ?></p>
2 {% I: V) {9 j& G, z - <?php } ?>) T# l2 a" O# I
- / A% `' M* a' u7 Q* i
- </div>
2 v6 L* | {" q7 M6 O9 \ - <!-- end post -->
$ F+ r7 \ {& c, c: m -
2 \# l( O6 O9 K# \$ ?, s+ F+ ~( [ - <?php endif; ?>' h' p; l) B, ?. x
- 2 j3 P; M, h& G
- <?php endwhile; endif; ?>
- [/ w% C5 z1 R, N( c - 3 H2 g0 ]! `$ t
- <?php } ?>3 `7 e2 H) Z( P2 ]5 N
-
/ L" D( j+ C& B0 ^ - <?php if ( !function_exists('dynamic_sidebar')2 C" z1 U% o8 I& e. {( L Z" R
- || !dynamic_sidebar('Ad Position 8') ) : ?>: o9 f2 N0 |5 [
- <?php endif; ?>- q6 ~ S0 z! r4 j) X
- - q1 f! p/ _7 V8 s9 G
- </div>
. ~7 v( _" i+ z1 _2 M* O; d - <!-- end leftcontent -->
# W- ]: X* S5 j0 k' D" e2 S- L - 6 ?8 f) ?% G" @
- <?php if(of_get_option('site_layout') == '3c-l' || of_get_option('site_layout') == '3c-r'){ ?>
3 x8 }, p& T0 _' l: y- d* ^: h( V - <div class="midcontent">
. f2 n5 R- y3 d7 s) S* p# V$ V+ S - <?php if ( !function_exists('dynamic_sidebar')) r, g2 o' A) `2 x6 _5 d! H/ A
- || !dynamic_sidebar('Middle Column') ) : ?>
& l. [/ c/ {: z- N" k! t - <?php endif; ?>2 s# I( o" ~9 K/ c( H7 j( G
- </div>
8 h* i# ~ i# J( C - <?php } ?>! V0 V& H* N) k, C9 D9 y5 g$ L
- $ g* Z! ^9 Q! D9 ]7 ]" S; L; x
- <?php get_footer(); ?>
複製代碼 這個代碼是不是有什麼問題?應該怎麼修改的呢?
* m1 ]$ w; U5 l9 I! S% z |