过期域名预定抢注

 找回密碼
 免费注册

wordpress專業解決問題

 火... [複製鏈接]
 樓主| 發表於 2013-7-18 05:49:22 | 顯示全部樓層
smallvally 發表於 2013-7-16 22:43 0 w/ v! v5 d1 v* c2 N7 _; ]
kankan大師,又來請教你一個難題了,$ c$ U* w. u! O) O8 j! C1 q
我最近有個站是個下載站,需要列出資源的 大小,型號,以及每篇都會有 ...
2 P6 L8 D8 {3 @+ g  X1 k! x
http://wordpress.org/plugins/advanced-custom-fields/  m5 V6 o6 d) z6 D# P
7 |. Y& e. G5 G9 |0 ?' H
用這個插件. 下面的鏈接教你怎麼在主題裡顯示.
# \6 K- D) y; J# M8 T+ m3 `( u( T7 y+ j0 r
http://www.advancedcustomfields.com/resources/getting-started/displaying-custom-field-values-in-your-theme/
( t/ b2 C) R1 p% R6 L/ ~3 ~8 I5 R% g  L0 Y$ V$ \$ X2 O

評分

參與人數 1點點 +3 收起 理由
smallvally + 3 感謝!

查看全部評分

回復 给力 爆菊

使用道具 舉報

發表於 2013-7-18 12:24:11 | 顯示全部樓層
零PHP基礎,看了下,貌似暫時駕馭不了啊,有時間再仔細琢磨下。感謝!, N3 T" Z/ {/ f8 g
回復 给力 爆菊

使用道具 舉報

發表於 2013-7-24 14:19:01 | 顯示全部樓層
樓主牛人 加好人一個
1 D, \3 |: W6 y希望樓主不吝賜教! M6 p1 @( m" ~2 d# R) Y# A
回復 给力 爆菊

使用道具 舉報

發表於 2013-8-23 17:49:36 | 顯示全部樓層
請問版主,XML-RPC的時候如果分類不存在能不能自動創建分類?能否給下相應的函數( i' H: D- K5 v
回復 给力 爆菊

使用道具 舉報

 樓主| 發表於 2013-8-24 12:59:29 | 顯示全部樓層
frankwng1985 發表於 2013-8-23 17:49 , S( g, t* x, g- J
請問版主,XML-RPC的時候如果分類不存在能不能自動創建分類?能否給下相應的函數
  s4 P/ J. ~- t( D4 \6 a ...
. [% Z: C: `. M: Q
wp-includes/class-wp-xmlrpc-server.php
" x* i/ X% M! ~  N/ R4 `
( F3 x0 n7 ?/ Q! k  m4 q2 N2 C" Ewp_newPost  函數.( x4 B! W" g0 X5 \/ C5 h1 ^
! h8 T( [* t8 i- H( L' H, @6 L& ~
看這個參數 terms_names - array, with taxonomy names as keys and arrays of term names as values
. g( o6 w& D) H" @! f- B, f# G8 L* }1 E, D- v$ x0 I+ Q0 c
跟蹤_insert_post函數, 發現會自動創建不存在的category.* p% D, y, Z& Q
) U, _/ i3 K5 D. U
好久沒研究xmlrpc了, 老版本wp是不支持的.  我也不知道什麼時候引進這個terms_names參數的,你自己研究下7 C9 ?% f7 D5 j! t/ s

4 U. ^1 y( L2 u# i; o& `& o' s9 [

0 @. ]/ n! ?3 b- T! ~& V
, L; n* l4 L  s& X3 Q4 x& R) k/ }: l
回復 给力 爆菊

使用道具 舉報

發表於 2013-10-10 21:36:10 | 顯示全部樓層
,我做的一個站,有個模板,為什麼首頁不顯示,是不是出現什麼問題的呢?我網站是:http://www.healthprotections.com
) ^! g% I7 G+ _) Y# `* c* F" u* E3 h3 C1 l( @& ?( V" J* S
首頁代碼是:
  1. <?php get_header(); ?>7 X, v/ B3 G3 B& }1 Y
  2. + D$ v( Z" s4 {- A. L
  3. <!-- content -->
    1 R6 S5 C; z: L& V
  4. <div class="content">
      t8 S- z2 @% A/ V
  5.        
    - q5 ~/ x0 B$ |
  6.         <?php if ( !function_exists('dynamic_sidebar')+ P  F6 H2 D2 J& W* X1 m4 \. V
  7.         || !dynamic_sidebar('Ad Position 2') ) : ?>
    6 T: Q, N9 l- `3 H- J& w  m, \% D3 P! Q
  8.         <?php endif; ?>; ^+ Q* \8 a' z. K4 D% f
  9.    
    1 b) i: Q: V# g' |& y* x) }) \9 \
  10.     <!-- leftcontent -->
    * J5 D/ C$ _7 z' y! E) r4 ^6 X
  11.     <div class="<?php if ( substr(of_get_option('site_layout'),-1) == 'l' ) { echo 'leftcontent-l'; } else { echo 'leftcontent';}?>">* H4 H( |( ~$ @8 N% j9 v: L
  12.                
    8 X5 R6 x3 h. K/ Z3 \
  13.                 <?php if ( !function_exists('dynamic_sidebar')
    " |9 v, y) e+ z4 {9 C: U
  14.                 || !dynamic_sidebar('Ad Position 3') ) : ?>$ y* u$ h: X6 C4 {' R$ h" N! I9 P
  15.                 <?php endif; ?>
    * r. k1 u$ ^4 j6 G% d: `6 z9 _0 ~
  16.         
    ) Q5 Z, T, V" I+ m2 _
  17.         <?php if ( of_get_option('homeheading') <> "" ) { ?> 7 ~6 `2 w4 r) l' @8 j$ p7 t8 ?, L
  18.         <h1 class="postmargin"><?php echo of_get_option('homeheading'); ?></h1>8 ]1 p2 N' x: R  i9 h
  19.         <?php } ?>1 W. |# v' _& ~

  20. ; v; M2 n6 v. R5 b5 p/ V& `  _
  21.         <?php if ( of_get_option('homeintro') <> "" ) { ?>+ t/ z, {( I8 K1 Y; w2 R8 r
  22.         <div class="intro">5 X7 G4 K1 n0 t; t; H8 Y
  23.                        
    * E3 w( \- I1 a. @
  24.                         <?php if ( !function_exists('dynamic_sidebar'); k8 `/ s% r' a. a! x
  25.                         || !dynamic_sidebar('Ad Position 5') ) : ?>
    ) J- i1 |( s6 o, C3 ^( ~2 a8 W, r
  26.                         <?php endif; ?>
    * a$ u- ]# t, `- `6 ~" }
  27.                        
    * H) V7 ~+ W/ |' Z  I# F! q
  28.                         <?php if ( !function_exists('dynamic_sidebar')
    - Y* R. G# X2 r4 q  K# k3 V
  29.                         || !dynamic_sidebar('Ad Position 6') ) : ?>6 e1 g' g$ J+ I1 h+ v5 O8 j: R. o
  30.                         <?php endif; ?>: @6 F' |! k* f& @! r  o: Y
  31.                         ( u. g8 E- P" G2 d$ f! A0 ?
  32.                 <?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 } ?>
    % c6 _# r2 o) v; O& `
  33.                         <?php echo stripslashes(of_get_option('homeintro')); ?>
    9 \5 N1 m  k; D5 H
  34.         </div>: G8 e' h( z, E: `
  35.         <?php } ?>
    , ^7 Z3 d8 c: W: F* \# x( N6 N
  36.                
    " g6 R1 I7 t+ x- a& T7 }
  37.                 <?php if ( !function_exists('dynamic_sidebar')/ N" P& @: g- E: n, n. _+ C
  38.                 || !dynamic_sidebar('Ad Position 7') ) : ?>' S1 O! V0 n8 H9 {! y" Y# b1 O
  39.                 <?php endif; ?>; t7 x4 A* k, P+ {0 q5 X& c
  40.                 . S# v% I8 q2 ]! E- D" j3 L5 m
  41.                 <?php if ( of_get_option('show_home_posts')) { ?>0 N7 O4 U  B7 N& I' G
  42.                
      q, W9 q! P5 g( X7 i: f/ ~- z7 ]
  43.                 <?php if ( of_get_option('categories_home') <> "" || of_get_option('home_posts') ) { ?>3 D' s+ k6 q9 X% f& k) S
  44.                         <?php $cattoinclude = of_get_option('categories_home'); ?>
    2 @* S, K! Q1 T
  45.                         <?php $homepostnumber = of_get_option('home_posts'); ?>
    ' }" }: r1 O$ R' d8 _% V! l$ }
  46.                 <?php query_posts('cat='.$cattoinclude.'&showposts='.$homepostnumber); ?>
    & ~  ?% ~% y, l& R+ u  ~* D# u
  47.                 <?php } ?>
    % t9 Y% m# {& D0 g3 t/ U0 Y- V3 B
  48.         & `4 \4 m: k% [; L  l
  49.                 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>% `8 K7 X& _$ x
  50.                 1 m9 _$ Q6 {0 x) `: {$ J7 i) Q8 b
  51.             <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'med-thumb' ); ?>! {. [& h9 d6 b: I% w3 B
  52.             <?php if ($image): ?>& a2 n7 `+ u5 r' G. r: E6 A
  53.                                         ) H% c1 V! f5 g: [; Q" A0 s$ Z
  54.                 <!-- post -->/ \  _# Z9 T: S" p
  55.                 <div class="post">
    : P! P" s8 \$ {" o% m
  56.                                         : U2 w4 C1 R1 V0 V
  57.                     <?php if ( of_get_option('home_excerpt')) { ?>
    4 N. R9 \0 R- B9 p
  58.                                
    6 ]# s- P; L3 D, z* i
  59.                         <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    3 {6 g6 U# ?1 [% B( [2 |
  60.                                                 <?php if ( of_get_option('showmeta')) { ?>% z2 j/ l7 s6 F. U' E) V$ a( a# P
  61.                         <div class="post_meta">
    $ g3 ?. T' q& P) e2 A- V. d$ U
  62.                             <ul>, z# U# g5 `) D8 f8 o2 @4 k
  63.                                 <li><?php the_time('M d, Y'); ?></li>  \1 l  C9 b" I% w) Q
  64.                                 <li>|</li>; z9 O, h8 ^2 B* ^& W
  65.                                 <li><?php the_category(', '); ?></li>
    8 r/ S8 f% x4 @5 b+ \; c
  66.                                 <li>|</li>
    # h& d/ E$ j" j" D( Y
  67.                                 <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>  q/ Z4 \4 ]1 q- j1 W+ J. P; ?5 d
  68.                             </ul>
    2 y* Y# T& U2 D! M
  69.                         </div>+ v: a' b& a% ~. Q
  70.                         <?php } ?>2 j% j( _% K- E- S
  71.                         <div class="postleft">- j$ L0 X' b1 `8 L
  72.                             <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>1 z4 U4 n8 V$ `& t
  73.                         </div>
    & L' d) s  S8 n7 }( V
  74.                         
    ; ~8 ?3 j; j! u5 c1 B& u- q9 a, P
  75.                         <div class="postright">7 j7 e+ z, r7 j  M) I
  76.                             <p><?php excerpt('200'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
    / ?( I0 E) U0 E0 h, _' }" O: J
  77.                         </div>, U& V8 U' ^$ T# }1 ]' Q& z- L: L
  78.                         * u6 ]) H( ~# h2 K! C" H8 w
  79.                         <div class="clear"></div>1 [2 H# P* G+ T7 i4 w7 T7 F) a
  80.                     # b  }5 ^3 [" N5 `
  81.                     <?php } else { ?>
      |& c, O9 V, R: A9 [: R
  82.                             4 v" `4 f: ^8 I  G
  83.                         <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
      h3 k9 E- N, ]4 |3 x4 q- t; L
  84.                                                 <?php if ( of_get_option('showmeta')) { ?>1 `5 N9 {5 F1 ?  \% ?+ S
  85.                                                 <div class="post_meta">( ?6 ^: z" T, \% O2 p) i3 A) v) e$ {
  86.                                                         <ul>
    ) p& f9 K! V0 [6 R' M# _
  87.                                                                 <li><?php the_time('M d, Y'); ?></li>
    ( a! W/ t* {1 O6 o1 k. x
  88.                                                                 <li>|</li>
    - o8 a7 @: x1 q- M
  89.                                                                 <li><?php the_category(', '); ?></li>2 B6 x5 s( N  [& r6 S
  90.                                                                 <li>|</li>
    + Y- ~: _' y7 k
  91.                                                                 <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>( ]3 }$ D* ~! c3 O' s
  92.                                                         </ul># m" h- I1 O% ^
  93.                                                 </div>
    4 ~, {1 q1 E; q* n8 y! q
  94.                                                 <?php } ?>; c# F& K3 z' P3 G3 n# V
  95.                         
    * a% t1 Z' A4 [, G
  96.                             <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>
      {$ ], P5 ]. `# J/ O4 e0 _; T: _
  97.                         
    3 |, J' H$ U* @* {
  98.                         <div class="clear"></div>
    , @7 X  @; z6 N, e6 P' S' `
  99.                     
    4 f( h+ {1 l3 _( }$ S" f
  100.                     <?php } ?>
    2 f5 x* ?4 ^7 w, y0 i
  101.                                                                 $ Z, s: _; K0 y
  102.                 </div>! L* C7 U& j" D
  103.                 <!-- end post -->
    2 x, E9 w+ a5 u6 K
  104.             
    ( Q" o# [, c7 J7 y) g* h5 ]1 ~
  105.             <?php else: ?>9 p7 N5 h# }/ j: s  o/ C
  106.                
    / L7 O5 h4 ?, J) ^0 m% [& r% Y
  107.                 <!-- post -->- c9 B2 Q* B2 h- c7 S& g
  108.                 <div class="post">2 M3 A! ]+ K* t2 W
  109.                     : _; u0 t: [) X6 L
  110.                                         <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    ' m$ I. [0 \+ t
  111.                                         <?php if ( of_get_option('showmeta')) { ?>
    2 c% g: p; R$ f) c) p- ~
  112.                                         <div class="post_meta">
    5 L- D) @. G5 ?# F% ]/ \4 L
  113.                                                 <ul>* [) N8 |4 y6 Y: D& f& V. w$ Q
  114.                                                         <li><?php the_time('M d, Y'); ?></li>
    2 s5 n3 k. v! Y1 e: E$ c4 t% P
  115.                                                         <li>|</li>- x4 ]  {. x$ q; Z
  116.                                                         <li><?php the_category(', '); ?></li>
    * s* F0 i6 I( U* U& x9 i: ^
  117.                                                         <li>|</li>5 }" q! X+ h# A; J" j2 f
  118.                                                         <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
    9 U# n9 S% Z5 j
  119.                                                 </ul>
    ; ?7 I7 \; ~3 B( C2 e3 K7 k
  120.                                         </div>. G* E6 g9 N- J; \0 f" d
  121.                                         <?php } ?>
    ) Y3 @& V6 Q) h
  122.                     <?php if ( of_get_option('home_excerpt')) { ?>
    ) w4 w( H( i5 b  I' q- ~
  123.                                         <p><?php excerpt('300'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>6 P$ ?4 |: M+ I: I3 [3 H
  124.                                         <?php } else { ?>
    9 a1 a7 @- E( S
  125.                                         <p><?php the_content(); ?></p>
    " m; O; M: ~8 b$ F3 I3 P6 A: T
  126.                                         <?php } ?>
    ; ~% R- p, D5 @  t" C
  127.                 ) {% ~. V2 O9 v4 J" ~, F, t! X' Q
  128.                 </div>
    3 Q2 @6 l( G; m* w0 L
  129.                 <!-- end post -->
    * q  ]* U" O. x- s6 N0 S% C1 }
  130.                 3 E% X+ j6 K* X, l0 m: C$ N
  131.             <?php endif; ?>
    " d" ]5 s( ^( X7 K/ d
  132.                 : N) L8 i0 o/ N2 W& P
  133.                 <?php endwhile; endif; ?>8 _' n8 C# s' s
  134.                 3 O- Y. O3 q! j) q% a( l
  135.                 <?php } ?>
    ; r5 x7 k: F4 p+ Q! V2 j
  136.                 0 v# t0 {, k. H* M, s+ L
  137.                 <?php if ( !function_exists('dynamic_sidebar')
    2 }; o, N& l: k. U- A" J. p
  138.                 || !dynamic_sidebar('Ad Position 8') ) : ?>9 @! [: C! g; B0 L
  139.                 <?php endif; ?>
    6 _6 T7 E: d  o$ ?
  140.     1 m2 \% ?4 {! ~0 y
  141.     </div>0 _0 i! a# a& K3 A/ _: S: O+ z6 `
  142.     <!-- end leftcontent -->
    1 H& C; s& X1 a0 j9 a
  143.         6 _6 Y, o) c. @3 H
  144.         <?php if(of_get_option('site_layout') == '3c-l' || of_get_option('site_layout') == '3c-r'){ ?>& C  \4 O2 U- i% u9 t8 l. M) l
  145.         <div class="midcontent">+ r# O6 ]! B/ V+ w3 V
  146.                 <?php if ( !function_exists('dynamic_sidebar')' S. ?+ ]5 ?" u2 K: x
  147.                 || !dynamic_sidebar('Middle Column') ) : ?>& L8 k7 T) [7 w0 }1 I$ _
  148.                 <?php endif; ?>: e% ?  x/ J' s# W
  149.         </div>
    - J" ^$ }1 f. [
  150.         <?php } ?>
    ! c, }& }& v& }5 x) M) Q
  151.     2 a2 \# \) |" v4 Z
  152.         <?php get_footer(); ?>
複製代碼
這個代碼是不是有什麼問題?應該怎麼修改的呢?( H1 V/ o: v( C# \7 w) S2 o
回復 给力 爆菊

使用道具 舉報

 樓主| 發表於 2013-10-12 11:08:36 | 顯示全部樓層
fnzxl 發表於 2013-10-10 21:36
- \6 e8 ?8 M; A) p- [8 p9 b,我做的一個站,有個模板,為什麼首頁不顯示,是不是出現什麼問題的呢?我網站是:http://www.healthprote ...
# u/ ^: F4 s& F& M5 r
額,這個帖子我都不關注了.
) `5 T4 }% M0 s3 j5 X! O. K  l, x- g" i& {- ?9 f% @
空白應該是主題有些錯誤.0 K0 @9 J8 i' t! e2 y, H7 q8 a( `
# @" w2 }& c& b3 l  ^  w- o
http://codex.wordpress.org/Debugging_in_WordPress#WP_DEBUG
1 H% r2 o2 E; B/ f+ g  c" V( ]" h# \0 T+ a) n

8 y; \  H) N6 t& [% c9 n加define('WP_DEBUG', true); 到 wp-config.php 看看
1 E6 M# E, L7 ^
5 U, _# q1 U/ ]3 t& C/ H
+ _" R* l7 l; j5 U
回復 给力 爆菊

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 免费注册

本版積分規則

过期高净值品牌域名预定抢注

點基

GMT+8, 2026-6-19 07:09

By DZ X3.5

小黑屋

快速回復 返回頂部 返回列表