,我做的一個站,有個模板,為什麼首頁不顯示,是不是出現什麼問題的呢?我網站是:http://www.healthprotections.com
# ^& C4 I; x; R# j' y8 x' u' j
8 W2 c- K4 c$ k3 l P首頁代碼是:- <?php get_header(); ?>
, ]8 B- i! C0 o# \
% W4 N$ ]$ p1 {/ h; H' ~2 T- <!-- content -->
$ D, j2 z* D' L$ F& @ - <div class="content">6 y! z8 U2 T! D1 B- |
- 5 Z4 F; F( a" O5 c$ C" |
- <?php if ( !function_exists('dynamic_sidebar')9 B9 j7 x1 {$ `* z/ x7 A6 r
- || !dynamic_sidebar('Ad Position 2') ) : ?>
& C9 U' J. B% g8 z - <?php endif; ?>" v/ c* K* g3 J% Y) G: }
-
5 e( ~5 r* C, M4 C3 B$ k; T4 d - <!-- leftcontent -->
1 n4 ]3 z! i/ E, S8 \ e1 e - <div class="<?php if ( substr(of_get_option('site_layout'),-1) == 'l' ) { echo 'leftcontent-l'; } else { echo 'leftcontent';}?>">
; A% [4 X& I5 w. b( t' ? -
- o. g5 @5 O* w9 F$ M! u - <?php if ( !function_exists('dynamic_sidebar')- y3 U& o! J) n9 b+ n$ @9 E f2 T6 L
- || !dynamic_sidebar('Ad Position 3') ) : ?>7 I4 l0 _2 O- W1 C! V& P
- <?php endif; ?>8 v1 i" L& e2 }# S) e
- @* `3 X/ r9 J; M! d
- <?php if ( of_get_option('homeheading') <> "" ) { ?> + L* d2 T( ^% R2 V0 j& J1 C, ]
- <h1 class="postmargin"><?php echo of_get_option('homeheading'); ?></h1>
. v2 Z" u1 x, f2 v- W% Z" | - <?php } ?>0 T8 m" _3 p; a( Q
- # q# R3 y6 Z$ J3 g9 L: H
- <?php if ( of_get_option('homeintro') <> "" ) { ?>
8 [" w8 z! e8 Q$ ?5 u - <div class="intro">
5 ?9 ~( H' r% i - * z; M' `4 Y0 E; a6 f1 f
- <?php if ( !function_exists('dynamic_sidebar')
- R0 U9 |( l# j- G0 s* ?9 P' M - || !dynamic_sidebar('Ad Position 5') ) : ?>
" C) \ |( o' F4 S8 E) I - <?php endif; ?>
, F5 D6 r5 @" p0 V E4 t3 V0 r -
/ L* I" t/ N$ e! j) { - <?php if ( !function_exists('dynamic_sidebar')
# ]0 r: T# C/ x - || !dynamic_sidebar('Ad Position 6') ) : ?>
" ~: _; _1 M' Z. `5 H" F% C - <?php endif; ?>- g, Q, X# I' p. N! Y0 Z
-
- Z. X6 _7 Y; x3 ? - <?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 } ?>. `" \5 M9 J; B( k3 x* L
- <?php echo stripslashes(of_get_option('homeintro')); ?>
; g$ ^; l, g8 U. w8 E$ j - </div># d P& Y, a4 ~6 W" G/ Z+ ?
- <?php } ?> \, q. }( G( F; @- c
-
" ~4 k+ e! \' ~/ t# q - <?php if ( !function_exists('dynamic_sidebar')' O$ O$ x" j/ j0 Z, n5 {
- || !dynamic_sidebar('Ad Position 7') ) : ?>2 r) U: r* t7 ?; i( I
- <?php endif; ?>4 p" F3 N3 [( T: ]
-
: X2 j( ]- e! m; ~ - <?php if ( of_get_option('show_home_posts')) { ?>) w) D1 w' R; | u% X! q, P! i! |
-
% f, h2 D. C8 J9 }) J# B0 _ - <?php if ( of_get_option('categories_home') <> "" || of_get_option('home_posts') ) { ?>
/ ?" }! \7 r3 i6 L - <?php $cattoinclude = of_get_option('categories_home'); ?>$ h4 Q3 G; ^9 B/ n B
- <?php $homepostnumber = of_get_option('home_posts'); ?>
4 z8 j/ Y4 |5 T# }7 q7 @! P2 R - <?php query_posts('cat='.$cattoinclude.'&showposts='.$homepostnumber); ?>8 j! i4 ]! H; [2 l# _
- <?php } ?># T& f3 w3 c4 h) ]# @0 a
-
& f( F+ \: D5 ~0 Q$ }& V2 @ - <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
: W. W3 e& z! }8 J) J. Z - 8 v" c8 \: _3 ~$ C7 \. A& c. x
- <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'med-thumb' ); ?>
3 h: V5 p, d! t- M$ V - <?php if ($image): ?>5 s. s5 n, B6 ]! g
-
) Y" f: _( T3 B' ~ - <!-- post -->
+ D6 z& b" A: f9 l+ ] - <div class="post">
3 H+ A) g; r" J6 z9 F1 p6 x0 v7 B, n - 7 y% h5 ^4 U I6 w3 E$ Y. a) V3 D
- <?php if ( of_get_option('home_excerpt')) { ?>9 w7 W3 E" z$ g# w" U
- ! p5 c ^; b2 h0 C
- <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
/ E' D" l/ n( e f& n0 C - <?php if ( of_get_option('showmeta')) { ?>3 F% [6 d Q: M$ C8 C v p9 Z: q
- <div class="post_meta">' B$ e1 ^4 X' ?2 `, p5 \2 k* ]
- <ul>0 E1 | k) ]" V- T6 X
- <li><?php the_time('M d, Y'); ?></li>* D, i5 Z6 L# ?( {
- <li>|</li>" }, y- n6 t3 [; `& u0 z
- <li><?php the_category(', '); ?></li>. e" s/ K5 j* e/ b
- <li>|</li>
# c6 m7 q4 k: W/ M4 y6 B - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
: k; {6 v( J7 |5 G - </ul>
( i2 s) f" `% x) G9 j8 K# h - </div>. Y) w9 c) T# `* g! C6 T `
- <?php } ?>
, b# ] a" v5 H8 V* k - <div class="postleft"> @* K( s( i8 D/ l
- <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>) E0 e2 }. m! B! Z; _: l, h1 H
- </div>4 u6 l) v: A! c& z0 K1 |
-
/ K% @0 c# n# ?- b3 } - <div class="postright">
& q% k4 {+ j4 @$ f' J B) F! } - <p><?php excerpt('200'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
2 e* r* |* }3 ? - </div>" D; ], m' T0 w9 a
-
- y7 b+ Y; i! O8 C1 f - <div class="clear"></div>% L! u F: {. p) u
- # L! _3 n* Z$ V1 `! y6 K6 M( r- h
- <?php } else { ?>' {3 ?4 x% S; x
- ) d; k( M' W& T) Q
- <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>4 _% i1 {2 a0 N( B6 ^7 Z
- <?php if ( of_get_option('showmeta')) { ?>- S2 a* Z( [' O. f" `: o
- <div class="post_meta">
" G5 ]$ e# ], y - <ul>
. x0 t6 k& M( ~1 u- s - <li><?php the_time('M d, Y'); ?></li>
. ~; t# E# {, Q0 U+ i - <li>|</li>( d$ R0 \5 L& t- F3 i% Z) z
- <li><?php the_category(', '); ?></li>) w* I7 a/ {6 ]
- <li>|</li>6 Q0 K% t- O1 C
- <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
. v+ u M5 F0 ^$ M7 o5 N/ l - </ul># s) t- U+ a3 j H5 n: M/ J/ E
- </div>, w/ \& ?: z3 ^4 w
- <?php } ?>
/ a6 l- y1 x# I/ b/ z6 J% I4 @% y -
I1 a( g/ R, ] - <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>2 ~$ `4 v; S/ [
-
+ [0 L* A& ^3 {0 i8 E - <div class="clear"></div>
/ F: g* U& Z( B -
% G: q+ L& q* ?: g# w - <?php } ?>1 k u. i7 d0 b8 s1 f# ?8 \
- 9 u3 t1 x! d; E
- </div>7 Y8 P2 w2 L {9 O# v* t! V
- <!-- end post -->
* T3 Y+ B, F6 Q* h$ A3 q$ T" j - 6 U4 e9 b! l+ l2 P1 ]
- <?php else: ?>) |. m t& \+ M% A
-
c. Z3 d$ u1 z/ i( F# t4 ~& y - <!-- post -->4 ]0 O$ t/ s1 {' e9 }
- <div class="post">. g' O) R( ]4 o0 m
-
- }: r8 a& l9 O% G* _4 ]& k% y3 I - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>' w+ B- a, q9 E5 Q1 v% i4 C! o2 d
- <?php if ( of_get_option('showmeta')) { ?>
* W5 R+ i1 l* H. O - <div class="post_meta">+ l7 X( _! G+ t, E" i7 `
- <ul>
, Z5 F$ o' i( D! R9 Q: j$ D - <li><?php the_time('M d, Y'); ?></li>
- G4 R! V: u; B- M$ g6 R5 O1 x - <li>|</li>
6 ?* g4 z8 w# r, z/ [# ` - <li><?php the_category(', '); ?></li>& \: h) D! C/ ~% j6 [% A/ G5 u
- <li>|</li>
U1 p9 G2 z" d7 a' d - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
/ a& B9 b$ Z0 i a( y+ I7 A0 } - </ul>
( N) Y3 j& C2 {; B0 @- m6 d - </div>
8 j4 Z2 [! e M d8 f2 O - <?php } ?>4 P1 O$ N) s" D0 y3 c& v b" _1 p" h
- <?php if ( of_get_option('home_excerpt')) { ?>% V8 a i( y7 T8 k: U
- <p><?php excerpt('300'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
( s% u+ S. T" [9 N# g4 S5 i - <?php } else { ?>8 T) W% a$ l$ W7 I- U1 N
- <p><?php the_content(); ?></p>7 W4 w9 Y# \+ F" F- f
- <?php } ?>9 t6 O2 Z2 e8 J- a2 o! |0 n
- : i) O+ Y# X, }1 s( h3 h9 K! s. P
- </div>
: k; a4 _3 S! K' {: W - <!-- end post -->9 f! p7 Z# ~' U, r+ e$ N
- : \& y1 y+ K& u/ Q& q7 ?4 K1 l
- <?php endif; ?>$ E! r! L% Z2 ]* O
- ) Z6 Y- D9 |4 G$ `# L# V
- <?php endwhile; endif; ?>' i' r) j- {9 v4 Y9 H
- + E5 `( _8 n, v
- <?php } ?>( ]: x# g. F6 X1 F: @- J+ O8 k
- + _6 w2 G+ `+ z" c% g
- <?php if ( !function_exists('dynamic_sidebar')% b/ K8 O. h V; i/ s+ n2 g
- || !dynamic_sidebar('Ad Position 8') ) : ?>3 m9 [( a3 a' g% k8 l1 z$ z7 M3 d
- <?php endif; ?>
: w( o0 T( G) |% l# ?9 Y7 | - 2 \! W) b% G+ ]' r3 n: E- m
- </div>! r- G( A6 R# ?7 E3 |
- <!-- end leftcontent -->
4 j6 u7 d G [# q" ~ - - z- o: t( L. H
- <?php if(of_get_option('site_layout') == '3c-l' || of_get_option('site_layout') == '3c-r'){ ?>
8 @# `5 S) A7 I" `0 w/ _ - <div class="midcontent">1 [4 G4 w1 ]9 T
- <?php if ( !function_exists('dynamic_sidebar')/ d* c2 R5 I5 ~7 f5 c2 `* {
- || !dynamic_sidebar('Middle Column') ) : ?>
; e( I& w# I: a - <?php endif; ?>
6 j: }& L& S( K8 x" m* F; j! i - </div>) C# ]# v- A# J: h2 a
- <?php } ?>5 r; M- t" K6 |/ t$ c- q% t& z- [+ I/ M% y
- + u! a2 X0 L' q% H/ H
- <?php get_footer(); ?>
複製代碼 這個代碼是不是有什麼問題?應該怎麼修改的呢?! L, Y! a% S" e; W+ N" d( r
|