过期域名预定抢注

 找回密碼
 免费注册

求助wp 略縮圖不顯示要怎麼調?

  [複製鏈接]
發表於 2013-6-10 13:39:48 | 顯示全部樓層 |閱讀模式
111.jpg
; B' E( e. J* ]3 {' c8 X. S" I& ]1 }, A7 h2 K# m
上面滾動每篇文章的略縮圖  不能夠顯示圖片出來。/ R2 I, Q4 |& ~+ G3 U
點擊鏈接進去能看到。請教要怎麼設置才能看到文章裡面的略縮圖片。
* i$ r; K1 G, l, h) @, w4 o" @! ?9 |: k4 d) R* T$ `, w
; k5 `; q3 X% G+ m3 m/ N! o* b
9 J9 ?/ H$ A. K1 n7 E' R' p  q
發表於 2013-6-10 13:42:31 | 顯示全部樓層
有可能是瀏覽器問題,建議換個瀏覽器試試.
) `& s* f, l/ j; w# F

點評

换了浏览器也一样  詳情 回復 發表於 2013-6-10 13:44
回復 给力 爆菊

使用道具 舉報

 樓主| 發表於 2013-6-10 13:44:16 | 顯示全部樓層
夢雨 發表於 2013-6-10 13:42 : E% _# r, I; \2 B& z6 Q2 N* I  t
有可能是瀏覽器問題,建議換個瀏覽器試試.

3 Y& Q6 t& C# R6 [+ W                      換了瀏覽器也一樣
3 I- n  t6 R  ~8 I3 ]
4 Z! w8 L/ I& s4 o  @  L. {
回復 给力 爆菊

使用道具 舉報

發表於 2013-6-10 13:51:33 | 顯示全部樓層
post裡面要設置featured image
. n# x/ g+ v5 H/ X

點評

就是这个  詳情 回復 發表於 2013-6-10 18:35
在这里面设置吗?  詳情 回復 發表於 2013-6-10 13:56
回復 给力 爆菊

使用道具 舉報

發表於 2013-6-10 13:56:39 | 顯示全部樓層
估計是調用的圖片位置不正確吧!
0 t% [6 j8 k8 l
回復 给力 爆菊

使用道具 舉報

 樓主| 發表於 2013-6-10 13:56:39 | 顯示全部樓層
luguokankan 發表於 2013-6-10 13:51
' X' q( Q1 c& g- @( cpost裡面要設置featured image

! ^/ D- x0 q! h# d: S% B在這裡面設置嗎?5 Z8 s: o0 {# e' d" Q9 b

; B5 p' t; M7 a  Y( f* n7 Y4 H7 n. c  [
<?php% b9 d" h3 X, ^" m, J  I
/*! l) @1 p1 p# @( m  T" B; E. H$ A
Plugin Name: Single Post Template
. p  c1 |+ x5 M. [3 A7 BPlugin URI: http://www.nathanrice.net/plugins
, {/ d; T. Y: c- F4 ]6 |% T% o' IDescription: This plugin allows theme authors to include single post templates, much like a theme author can use page template files.
' L" I1 q1 q, W% l' oVersion: 1.3
4 B, ^2 z! u3 h1 Z7 c9 @# F5 Z# fAuthor: Nathan Rice+ J, m( K- m4 N( \
Author URI: http://www.nathanrice.net/
. q6 G7 u! ^; E
, K9 O& V6 Y8 q4 R6 E1 qThis plugin inherits the GPL license from it's parent system, WordPress.4 n* s6 a- O9 S
*/2 F; d! b$ H, ~( d& {
4 A, E1 A9 O  n
//        This function scans the template files of the active theme, , G% ]: K& t. H6 \
//        and returns an array of [Template Name => {file}.php]
. @' W2 L8 z6 B7 _if(!function_exists('get_post_templates')) {5 |) N* C" |( m+ {, d! o- ]
function get_post_templates() {: Y! U+ Q& z- q3 u  V* L
        $themes = get_themes();+ y& L$ g& l' U% u: l8 K
        $theme = get_current_theme();$ x7 q8 c! \0 x( v5 z
        $templates = $themes[$theme]['Template Files'];/ U% j- O( @9 j) j1 C
        $post_templates = array();
1 ]3 V3 ^2 m4 b$ ?6 `* Y& B* f+ }$ @0 X) T
        $base = array(trailingslashit(get_template_directory()), trailingslashit(get_stylesheet_directory()));6 \% P3 h  \  O! f$ |9 s
: V* S+ U  `  @, K
        foreach ((array)$templates as $template) {
- ?% T+ X! n8 D) d9 J9 o                $template = WP_CONTENT_DIR . str_replace(WP_CONTENT_DIR, '', $template); 0 K  ^% x" P4 u7 e6 a5 i
                $basename = str_replace($base, '', $template);
' _6 ]7 Q. h; D# Y
* B& W5 E4 r% y$ h' s- w7 _& ~                // don't allow template files in subdirectories
  g# l( q: m1 F$ o; V" G3 A                if (false !== strpos($basename, '/'))
6 E' `$ }0 G& J+ n- W) n                        continue;/ N; V# d# f) c. w  f& A3 {

2 P8 d" U7 T+ J! N* l                $template_data = implode('', file( $template ));/ Q+ ], j/ K1 z8 T
4 V& \. O; e) d5 p2 K
                $name = '';, s  ~& x# Q8 t& {4 }
                if (preg_match( '|Single Post Template.*)$|mi', $template_data, $name))" x% ?: u7 A7 V2 Z6 B: Y+ ~9 y
                        $name = _cleanup_header_comment($name[1]);
& n# I" M2 ]' M4 I+ G" C, H! W' u# S6 `3 J
                if (!empty($name)) {
  J) I' [( t4 c' s. l! M( \! [& x                        if(basename($template) != basename(__FILE__))  s) }9 v/ {7 }3 [, j$ u. s  }
                                $post_templates[trim($name)] = $basename;& N6 U+ x3 E' J& h/ p, @  A; e7 x
                }0 u, {% [7 ~- s5 B+ m8 z$ p% I
        }
* Z/ I9 [& V9 F
! f, h: `2 |% R: m; y        return $post_templates;8 z% O- ]# B9 z' f' Q% q/ T7 j
! u. g8 c( {* }. t# R
}}1 z! r' c9 Y) A  @& ~* D0 s2 e

* T; M# N4 Y3 u//        build the dropdown items
. b0 ?2 c0 Q  T) M' ~+ {if(!function_exists('post_templates_dropdown')) {
, O0 K, ?% |6 zfunction post_templates_dropdown() {& h  O5 \# \+ T( B
        global $post;
, P$ ^; I8 l  |' c        $post_templates = get_post_templates();/ r3 p% H' Z. V. A: `) b( {
       
# H, k3 ?; r# J$ \. v" U! a        foreach ($post_templates as $template_name => $template_file) { //loop through templates, make them options
. G+ D0 T" ^, l% R/ s. ~; ~3 `# J. x                if ($template_file == get_post_meta($post->ID, '_wp_post_template', true)) { $selected = ' selected="selected"'; } else { $selected = ''; }
3 ~/ W; m* _: F* o                $opt = '<option value="' . $template_file . '"' . $selected . '>' . $template_name . '</option>';
4 }  f% G$ a# g: y, N                echo $opt;( c2 T& z4 q9 _0 Y. w
        }
% |# U: N, y! r3 m# |( a}}. F  @6 L1 e' j9 j5 \

6 h7 p* o0 C( z- e! v. h//        Filter the single template value, and replace it with
! c! q# g5 k9 Z: F0 g//        the template chosen by the user, if they chose one.
  {& f8 G0 L. o8 u; m9 `5 D, @add_filter('single_template', 'get_post_template');
# A1 i+ i! D4 ], g$ dif(!function_exists('get_post_template')) {- q5 ~0 V9 @+ C& a, c/ j4 B( i; N* e
function get_post_template($template) {
3 e  u* g  ]( t" e        global $post;; T5 W- F, D7 K$ }
        $custom_field = get_post_meta($post->ID, '_wp_post_template', true);3 Q0 ~7 c* u" `, g0 u, x
        if(!empty($custom_field) && file_exists(TEMPLATEPATH . "/{$custom_field}")) {
0 J) w/ i) X7 g  ~# |                $template = TEMPLATEPATH . "/{$custom_field}"; }  A$ v0 W! Q. c4 a# |4 p2 K7 t- d  I
        return $template;
$ j/ }! P. f: u) D" Z' _}}  L+ G7 A6 N( T- F" x$ ?* ?

6 _9 `8 Z4 i$ X/ K+ v9 k0 O//        Everything below this is for adding the extra box; Y; ?6 Y; P0 L- A
//        to the post edit screen so the user can choose a template/ J0 X2 V- v' `' C, [$ }  _

: ?" f# \7 ?# w6 ]2 A//        Adds a custom section to the Post edit screen
, o, `9 d8 b$ Hadd_action('admin_menu', 'pt_add_custom_box');9 }# G0 y+ w- B' \: f0 H
function pt_add_custom_box() {
  p1 f7 i6 v! f" W* Y( \' Y2 b. V        if(get_post_templates() && function_exists( 'add_meta_box' )) {
6 n/ a2 E8 O( d: N                add_meta_box( 'pt_post_templates', __( 'Single Post Template', 'pt' ), / z2 T5 }* B0 y0 M; ^' g/ Z
                        'pt_inner_custom_box', 'post', 'normal', 'high' ); //add the boxes under the post
' R) l, P. D+ C7 ~4 x' A3 G/ K        }
' k* Q9 q& a6 u4 q' |7 L}
2 J/ k8 @* X4 ^6 u
# |  ?6 R& F; P$ r0 R//        Prints the inner fields for the custom post/page section% P# g- z* b# a, P
function pt_inner_custom_box() {
2 w' D2 ?5 N- z3 [: Q& x        global $post;
+ R% J4 a9 R+ t/ X5 P/ `0 W        // Use nonce for verification
6 J  D% E/ R- Q4 |. |' S        echo '<input type="hidden" name="pt_noncename" id="pt_noncename" value="' . wp_create_nonce( plugin_basename(__FILE__) ) . '" />';
1 D( c' Q; |4 ], h! g3 Z        // The actual fields for data entry
  T; U  a/ L5 z9 f+ \        echo '<label class="hidden" for="post_template">' . __("ost Template", 'pt' ) . '</label><br />';+ _7 Z# z( x' \4 j. w0 ?
        echo '<select name="_wp_post_template" id="post_template" class="dropdown">';
& g' ^5 a, H& y1 W) _        echo '<option value="">Default</option>';. v% q% l; V+ D+ L; U& B
        post_templates_dropdown(); //get the options+ `) e+ Q7 m8 j, |) B
        echo '</select><br /><br />';
. r3 P9 K8 F4 r9 g* d        echo '<p>' . __("Some themes have custom templates you can use for single posts that might have additional features or custom layouts. If so, you』ll see them above.", 'pt' ) . '</p><br />';
4 e0 K: M+ ~- l# U3 w4 p1 O( L}
. R+ G" w9 ^9 R# B' j. w+ d. W5 w$ P$ w' a# k- i* r8 M  Z
//        When the post is saved, saves our custom data
% \( k0 N' U5 P: k5 Wadd_action('save_post', 'pt_save_postdata', 1, 2); // save the custom fields
" m/ A. Y! N& \5 a3 h7 bfunction pt_save_postdata($post_id, $post) {
! o* t, o" ]9 k$ e       
: U: C2 k/ g' j; h5 [- s        // verify this came from the our screen and with proper authorization,
/ i( e8 p9 L1 w        // because save_post can be triggered at other times
( E7 c- k4 l/ k9 q. e) a6 x9 P- s        if ( !wp_verify_nonce( $_POST['pt_noncename'], plugin_basename(__FILE__) )) {" \/ b6 H5 }  l" E+ c  r
        return $post->ID;# G2 x# q- J  G2 N- X
        }
1 k# c- \  p) @2 D1 y- L0 ^
% ^* P2 {. P3 {( N+ V        // Is the user allowed to edit the post or page?
3 Q, w/ g- K# y" {        if ( 'page' == $_POST['post_type'] ) {9 s; V. A4 p. Q+ q2 w' }' j2 ]% E
                if ( !current_user_can( 'edit_page', $post->ID ))) Z5 Q9 p, T5 u# E
                return $post->ID;( d6 V, V! w) K# n( R8 O( S
        } else {; V' M+ p, I4 T. x! F/ s  B& L- i1 X( O
                if ( !current_user_can( 'edit_post', $post->ID ))
3 [# u. J- K& B! `  p# C3 h0 ^  l# r                return $post->ID;6 C7 G/ t- o. ^5 P
        }
+ M- C' @6 \: O- S* T) }' n! n/ @6 @; e" g1 F" c
        // OK, we're authenticated: we need to find and save the data! _" `/ e+ C, q
       
$ V- K7 m3 r1 n% c% S        // We'll put the data into an array to make it easier to loop though and save
2 D  M9 [( J6 y& H4 u        $mydata['_wp_post_template'] = $_POST['_wp_post_template'];
' u; H; P' n" a( p1 q( h4 v        // Add values of $mydata as custom fields
3 `& n* p1 {8 G% L  j        foreach ($mydata as $key => $value) { //Let's cycle through the $mydata array!  M; k+ f2 A  `) q3 p9 L5 p
                if( $post->post_type == 'revision' ) return; //don't store custom data twice
+ N; U6 {& E( |) o7 S5 \7 E8 e1 b: ?                $value = implode(',', (array)$value); //if $value is an array, make it a CSV (unlikely)) F/ b3 `+ M, z) K/ Z7 ]
                if(get_post_meta($post->ID, $key, FALSE)) { //if the custom field already has a value...2 P, l  e0 _: b
                        update_post_meta($post->ID, $key, $value); //...then just update the data# q+ j/ W1 x) f( M3 y4 D
                } else { //if the custom field doesn't have a value...
8 P/ w) d3 g  b; J                        add_post_meta($post->ID, $key, $value);//...then add the data, q" j2 [* Y. I$ P2 P7 |: s" C
                }! G) W' F: \  s4 s$ G9 [4 b3 w8 G5 t
                if(!$value) delete_post_meta($post->ID, $key); //and delete if blank7 o* z3 n$ W( v) i
        }
/ ^- u3 X9 n9 L, _9 E2 J" e}
- Y8 D" m  J" v" t?>+ ~' G6 h9 p# u1 w# [3 @( |

3 y4 f3 C, P) c( t( i1 C. E' G- V/ `4 J. t4 I
回復 给力 爆菊

使用道具 舉報

發表於 2013-6-10 14:15:06 | 顯示全部樓層
可以參考以下的文章設置.
& l& E! \) ~- r  Q: L" k$ ]5 thttp://down.chinaz.com/try/201110/1261_1.htm: @& d" T3 Y" N$ o1 p+ j  f
回復 给力 爆菊

使用道具 舉報

發表於 2013-6-10 14:50:29 | 顯示全部樓層
3.5已經支持了 ,直接選上featured image就可以了0 P9 s/ U& c" c- G

點評

请教有具体步骤吗?这个不会。  詳情 回復 發表於 2013-6-10 15:02
回復 给力 爆菊

使用道具 舉報

 樓主| 發表於 2013-6-10 15:02:44 | 顯示全部樓層
chenkui 發表於 2013-6-10 14:50
8 f" r! _5 p/ S' e3.5已經支持了 ,直接選上featured image就可以了
; Q) e+ R$ j& U( i% V4 L, M
               請教有具體步驟嗎?這個不會。# H4 N6 G- c: W5 i
回復 给力 爆菊

使用道具 舉報

 樓主| 發表於 2013-6-10 15:15:17 | 顯示全部樓層
featured image   找半天真的找不到這個featured image這個選項! Y4 f! e( @) _/ `, h
回復 给力 爆菊

使用道具 舉報

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

本版積分規則

點基跨境 數位編輯創業論壇

GMT+8, 2025-7-11 09:08

By DZ X3.5

小黑屋

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