,我做的一個站,有個模板,為什麼首頁不顯示,是不是出現什麼問題的呢?我網站是:http://www.healthprotections.com8 F: v. `& O u6 o
& ?& [% l2 }' o7 u$ Y0 N
首頁代碼是:- <?php get_header(); ?>
3 D9 ~' U" c8 T9 S* E
! e2 A% o4 U- a) @, m6 i4 ?0 i- <!-- content -->
% }4 Y$ {8 y |' B! r; N5 d - <div class="content">
. Q3 Q! H5 V& r e. B# z5 _ - ) v5 J2 p& c# @# ]
- <?php if ( !function_exists('dynamic_sidebar')
& n9 B) B7 [" @) k, x) C5 E - || !dynamic_sidebar('Ad Position 2') ) : ?>1 Q t$ O& G8 o+ X' |& ~( m0 q8 \
- <?php endif; ?>
# ^5 y7 O; `1 ` -
. k& [# n9 [% f - <!-- leftcontent -->: o' Y& m1 V3 m, n# l" C. Q
- <div class="<?php if ( substr(of_get_option('site_layout'),-1) == 'l' ) { echo 'leftcontent-l'; } else { echo 'leftcontent';}?>">+ |6 \& x& J% b/ W1 k
- & T& }, Z `( \+ _- J7 e8 x
- <?php if ( !function_exists('dynamic_sidebar')' _1 w* L: |4 n6 m- J$ g: X- B
- || !dynamic_sidebar('Ad Position 3') ) : ?>' ^7 S1 H# ?+ X s% Y
- <?php endif; ?>
; Z/ j& s+ b. u, |/ K$ h -
# x8 ^& e3 K6 S# p9 b/ Y - <?php if ( of_get_option('homeheading') <> "" ) { ?>
4 P# U0 d; r! }6 G9 C4 @ - <h1 class="postmargin"><?php echo of_get_option('homeheading'); ?></h1>
+ K) c& R2 [# j/ V2 c0 D& |' \& I - <?php } ?>
& u7 c) P# F. S - 3 D# i: I) J. b/ e( U* e% R
- <?php if ( of_get_option('homeintro') <> "" ) { ?>
+ q7 A' A/ v. U7 [6 X, L - <div class="intro">
& I7 `9 _7 C/ ?% [ -
) _1 Z% ]- U. I - <?php if ( !function_exists('dynamic_sidebar')
' x( Q' S# B8 s4 J/ h3 N. h. j H - || !dynamic_sidebar('Ad Position 5') ) : ?>( r7 u5 `9 h/ n
- <?php endif; ?>( |8 Q* N/ D/ b- L8 A. D% p9 p
- * T6 ?/ V: }( T& l. ^# F9 c R: p
- <?php if ( !function_exists('dynamic_sidebar')
6 K& ]1 d+ r. B - || !dynamic_sidebar('Ad Position 6') ) : ?>) @! E/ z) z. |
- <?php endif; ?>
/ b/ q) w) D2 }) w- [* V -
% N( \& R' c/ r5 Z( h - <?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 } ?>
! b, `! j) B G9 T- r$ U - <?php echo stripslashes(of_get_option('homeintro')); ?>
& [# K8 A) R0 ~$ t9 m - </div>
. f# Y. M7 ~ _ w; G4 x - <?php } ?>! t0 C3 s9 k5 `2 }9 R4 n
-
0 g1 g) Z: F/ c( n - <?php if ( !function_exists('dynamic_sidebar'): F& x" j2 g* C2 P
- || !dynamic_sidebar('Ad Position 7') ) : ?>6 E. R8 a" `- V1 j( F3 `! |# \8 W8 g
- <?php endif; ?>
; i4 n6 v* r6 b# s - 7 r9 C# ~& _$ t. B n/ h) k
- <?php if ( of_get_option('show_home_posts')) { ?>
5 y- v3 J: ]5 M. A - . K! L' L& h! w% c( Q9 X" ~# N
- <?php if ( of_get_option('categories_home') <> "" || of_get_option('home_posts') ) { ?>
3 r% { m7 u h3 [% u3 Z" U& q ]; d8 ] - <?php $cattoinclude = of_get_option('categories_home'); ?>/ r; p6 n# o) W- a- G/ N
- <?php $homepostnumber = of_get_option('home_posts'); ?>3 y) _ p9 @9 W; f! r- o5 J. \
- <?php query_posts('cat='.$cattoinclude.'&showposts='.$homepostnumber); ?>& E2 F2 h1 Q0 S4 U# O" i0 R0 t
- <?php } ?>" W* c1 P- |4 f) S
- - {6 z# X8 ~( T4 l# h6 a+ ]9 d
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>3 O. @' Z7 d: c9 S5 F
- 8 X# {2 g* I. B3 e# K
- <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'med-thumb' ); ?>
- ^$ F) y. `# o - <?php if ($image): ?> e7 a2 L( ?4 Y( g- d: s0 I+ q9 ]
-
+ w; U+ l, r9 \6 C* K ], Y( G - <!-- post -->& n5 `( V' D% A9 Y# P( ]( D
- <div class="post">
! Y% t- [9 S' ^8 Y; ~3 Z - 7 \) b o; _5 g1 H9 ~
- <?php if ( of_get_option('home_excerpt')) { ?>
; k' n! ?( w, f2 f1 S -
* g$ S, w( {" U7 f/ `% B0 A! ^3 l - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>% k( h4 z+ _+ m) g9 V b
- <?php if ( of_get_option('showmeta')) { ?>% j) R1 g- R: I6 c
- <div class="post_meta">: Y/ _+ x/ x* L% Z% [* `
- <ul>$ y& [8 u' o: R% r
- <li><?php the_time('M d, Y'); ?></li>9 O+ G: T, i: p6 ~
- <li>|</li>
- I) W& p& E. Y- M: ` - <li><?php the_category(', '); ?></li>
8 [1 Y6 E$ Y' t' x( U) o - <li>|</li>3 W! a( u$ d* R9 F+ P2 W% [" k4 H
- <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>8 x# }7 z) M" [, C- } `( [) v
- </ul>
. g, o/ j) g* ~( A* t; s - </div>9 p/ a2 V9 n: v6 F% _1 r; o/ `
- <?php } ?>3 _2 }6 [/ [. r) `7 X
- <div class="postleft">4 f( [, v& C3 x3 y& x
- <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>4 x) P3 j3 g6 \8 v9 A$ `
- </div>
2 i) o$ \7 W3 L( @! S -
- {1 B* f3 I. ?2 Q5 R - <div class="postright"> C8 K5 C+ m8 L( X% u7 j' j
- <p><?php excerpt('200'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
% |' t5 O( W" _5 F) ] - </div>
& d+ D0 D; [. P2 f0 Z* V. O -
9 z2 o" ^# j9 Z - <div class="clear"></div>
9 I- F' L* I& B ~ - : @3 ^2 W. k5 F4 v, E! h# S7 W: W8 M" S
- <?php } else { ?>
. f/ V. I# [% D" D" p* ?# u - % b: @: T9 M6 Q% R- s' v" E- G
- <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
1 C. {+ ?% f+ _( P; o+ z3 c3 R3 o - <?php if ( of_get_option('showmeta')) { ?>2 h6 ^; Y9 b* W7 a! K4 ^
- <div class="post_meta">
# L. i1 {) F* g6 b: L - <ul>
3 E* p5 l- E' ]8 e - <li><?php the_time('M d, Y'); ?></li>
$ Y4 W! P' N+ ]+ N' U - <li>|</li>
( b! ~' m3 B7 L' M4 ^* Z+ x, ^ - <li><?php the_category(', '); ?></li>9 J5 l7 R; n6 M; d
- <li>|</li>
; G g2 X" p8 {" b - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>: \) o3 F) u* {. x" x
- </ul>
/ }. F- l7 D5 G. y; e - </div>; L! D) W& R- b4 Q7 Y' d3 C
- <?php } ?>
. I: H M1 d( H/ _ -
: f n; D, o/ O/ N' K - <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>" |" {3 U, O+ H4 k# W' Q+ ~6 e9 {! `4 B6 \
-
/ a6 R" @# D& c+ a1 ] - <div class="clear"></div>6 W& s& m9 m; ]6 T! t* @+ p* Z7 h
-
E& M9 a1 X9 W) c( G) J( e - <?php } ?>
% g5 Q! k# {: c0 f) p9 d+ D1 Y# M+ U - 8 o# T- l0 t6 a
- </div>
% k5 w( F9 d5 w4 M3 s& g - <!-- end post -->
- P' | W) p& ~4 w -
- \7 j, ?6 |3 @' L* b2 B4 \, p% @ - <?php else: ?>$ E' v ^9 _6 d
- ) h* v. d* Z, }9 V' O; B
- <!-- post -->: `6 ]3 A' J3 V* ?
- <div class="post">. m" H# O; R( w
-
" o8 q; l3 n8 U - <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>* {. D# i! \& F, {0 \
- <?php if ( of_get_option('showmeta')) { ?>
' @. f9 n, W4 S7 ]5 ? o7 H - <div class="post_meta">1 e3 u R4 l; }6 W9 d5 C/ L
- <ul>1 V& c2 D4 P9 r9 ~ T4 ^
- <li><?php the_time('M d, Y'); ?></li>
* _% n \8 ]5 I+ Z* ?9 \/ o - <li>|</li>( B# A6 T" a4 d, }( X: c* r
- <li><?php the_category(', '); ?></li>
3 D1 W; l) E( N' q9 r - <li>|</li>
2 p5 f4 d5 T3 H! ~4 A - <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
) q+ z A0 ^( ]; H - </ul>
# A' m' k' m7 k - </div>$ F. p# f" J+ `2 v1 l* c; C* {
- <?php } ?>
) p+ M4 X5 f2 z8 j2 K/ r# h7 t - <?php if ( of_get_option('home_excerpt')) { ?>2 H( X$ y8 z( B8 b
- <p><?php excerpt('300'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
3 P/ Z4 T& c9 ?% D3 S) H* u - <?php } else { ?>$ X: s, f- |5 S% C
- <p><?php the_content(); ?></p>8 V9 c9 u y9 O+ M4 a
- <?php } ?>
) E5 D' d5 ~8 R -
# l+ G8 G- L3 W8 ] - </div>
4 A, o1 ~0 m( l' A) f3 c' f - <!-- end post -->, ^4 m9 P2 f: n* M0 c
-
: D" M6 x3 a; w' t - <?php endif; ?>
1 n+ H7 Q( t9 e3 ^ - 3 s/ B8 e2 W- _! v! i# m: ]
- <?php endwhile; endif; ?>
( w) D' ?, g1 |: K" M, e& q7 y5 b - 3 G8 i' O' _4 [( \
- <?php } ?>
8 Q6 S' C6 z, `7 X- N! U9 k ? - $ k" {9 \' z% H v4 U
- <?php if ( !function_exists('dynamic_sidebar')- f% l5 y5 [5 K
- || !dynamic_sidebar('Ad Position 8') ) : ?>
6 W4 N9 [$ z( N+ G+ W/ B7 e - <?php endif; ?>
5 i5 H; q& w2 e) w1 I4 ~7 ^ -
, ^- z$ y8 f a5 q - </div>) `% \- M! `& C! _) \
- <!-- end leftcontent -->
' j7 F0 v$ H. a - : U6 k: m# N9 H- F- ]
- <?php if(of_get_option('site_layout') == '3c-l' || of_get_option('site_layout') == '3c-r'){ ?>
; \1 V+ X* ~4 N0 M+ ` - <div class="midcontent">& |& E* I. x* ?4 e2 p
- <?php if ( !function_exists('dynamic_sidebar')
2 R4 ~) G/ N" j( e) b# E; { - || !dynamic_sidebar('Middle Column') ) : ?>
8 w4 S7 `; `3 L% k2 m0 m; }) s - <?php endif; ?>
4 Z8 h3 V; H1 ^5 l9 K7 g - </div>2 _) g1 {8 q) J8 }3 q+ Y$ r Q" H
- <?php } ?>8 s* o( p8 o2 X1 Y7 Z
- # p# E- S. H) {" q* M% F5 s
- <?php get_footer(); ?>
複製代碼 這個代碼是不是有什麼問題?應該怎麼修改的呢?5 v6 n, A" h8 S; S3 F$ t
|