EEfaq论坛-赚客自留地

 找回密码
 免费注册
楼主: luguokankan

wordpress专业解决问题

  [复制链接]
 楼主| 发表于 2013-7-18 05:49:22 | 显示全部楼层
smallvally 发表于 2013-7-16 22:43
kankan大师,又来请教你一个难题了,
我最近有个站是个下载站,需要列出资源的 大小,型号,以及每篇都会有 ...

http://wordpress.org/plugins/advanced-custom-fields/

用这个插件. 下面的链接教你怎么在主题里显示.

http://www.advancedcustomfields.com/resources/getting-started/displaying-custom-field-values-in-your-theme/

评分

参与人数 1e币 +3 收起 理由
smallvally + 3 感謝!

查看全部评分

回复 支持 反对

使用道具 举报

发表于 2013-7-18 12:24:11 | 显示全部楼层
零PHP基础,看了下,貌似暂时驾驭不了啊,有时间再仔细琢磨下。感谢!
回复 支持 反对

使用道具 举报

发表于 2013-7-24 14:19:01 | 显示全部楼层
楼主牛人 加好人一个
希望楼主不吝赐教
回复 支持 反对

使用道具 举报

发表于 2013-8-23 17:49:36 | 显示全部楼层
请问版主,XML-RPC的时候如果分类不存在能不能自动创建分类?能否给下相应的函数
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-8-24 12:59:29 | 显示全部楼层
frankwng1985 发表于 2013-8-23 17:49
请问版主,XML-RPC的时候如果分类不存在能不能自动创建分类?能否给下相应的函数
...

wp-includes/class-wp-xmlrpc-server.php

wp_newPost  函数.

看这个参数 terms_names - array, with taxonomy names as keys and arrays of term names as values

跟踪_insert_post函数, 发现会自动创建不存在的category.

好久没研究xmlrpc了, 老版本wp是不支持的.  我也不知道什么时候引进这个terms_names参数的,你自己研究下




回复 支持 反对

使用道具 举报

发表于 2013-10-10 21:36:10 | 显示全部楼层
,我做的一个站,有个模板,为什么首页不显示,是不是出现什么问题的呢?我网站是:http://www.healthprotections.com

首页代码是:
  1. <?php get_header(); ?>

  2. <!-- content -->
  3. <div class="content">
  4.        
  5.         <?php if ( !function_exists('dynamic_sidebar')
  6.         || !dynamic_sidebar('Ad Position 2') ) : ?>
  7.         <?php endif; ?>
  8.    
  9.     <!-- leftcontent -->
  10.     <div class="<?php if ( substr(of_get_option('site_layout'),-1) == 'l' ) { echo 'leftcontent-l'; } else { echo 'leftcontent';}?>">
  11.                
  12.                 <?php if ( !function_exists('dynamic_sidebar')
  13.                 || !dynamic_sidebar('Ad Position 3') ) : ?>
  14.                 <?php endif; ?>
  15.         
  16.         <?php if ( of_get_option('homeheading') <> "" ) { ?>
  17.         <h1 class="postmargin"><?php echo of_get_option('homeheading'); ?></h1>
  18.         <?php } ?>

  19.         <?php if ( of_get_option('homeintro') <> "" ) { ?>
  20.         <div class="intro">
  21.                        
  22.                         <?php if ( !function_exists('dynamic_sidebar')
  23.                         || !dynamic_sidebar('Ad Position 5') ) : ?>
  24.                         <?php endif; ?>
  25.                        
  26.                         <?php if ( !function_exists('dynamic_sidebar')
  27.                         || !dynamic_sidebar('Ad Position 6') ) : ?>
  28.                         <?php endif; ?>
  29.                        
  30.                 <?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 } ?>
  31.                         <?php echo stripslashes(of_get_option('homeintro')); ?>
  32.         </div>
  33.         <?php } ?>
  34.                
  35.                 <?php if ( !function_exists('dynamic_sidebar')
  36.                 || !dynamic_sidebar('Ad Position 7') ) : ?>
  37.                 <?php endif; ?>
  38.                
  39.                 <?php if ( of_get_option('show_home_posts')) { ?>
  40.                
  41.                 <?php if ( of_get_option('categories_home') <> "" || of_get_option('home_posts') ) { ?>
  42.                         <?php $cattoinclude = of_get_option('categories_home'); ?>
  43.                         <?php $homepostnumber = of_get_option('home_posts'); ?>
  44.                 <?php query_posts('cat='.$cattoinclude.'&showposts='.$homepostnumber); ?>
  45.                 <?php } ?>
  46.         
  47.                 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  48.                
  49.             <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'med-thumb' ); ?>
  50.             <?php if ($image): ?>
  51.                                        
  52.                 <!-- post -->
  53.                 <div class="post">
  54.                                        
  55.                     <?php if ( of_get_option('home_excerpt')) { ?>
  56.                                
  57.                         <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  58.                                                 <?php if ( of_get_option('showmeta')) { ?>
  59.                         <div class="post_meta">
  60.                             <ul>
  61.                                 <li><?php the_time('M d, Y'); ?></li>
  62.                                 <li>|</li>
  63.                                 <li><?php the_category(', '); ?></li>
  64.                                 <li>|</li>
  65.                                 <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
  66.                             </ul>
  67.                         </div>
  68.                         <?php } ?>
  69.                         <div class="postleft">
  70.                             <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>
  71.                         </div>
  72.                         
  73.                         <div class="postright">
  74.                             <p><?php excerpt('200'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
  75.                         </div>
  76.                         
  77.                         <div class="clear"></div>
  78.                     
  79.                     <?php } else { ?>
  80.                            
  81.                         <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  82.                                                 <?php if ( of_get_option('showmeta')) { ?>
  83.                                                 <div class="post_meta">
  84.                                                         <ul>
  85.                                                                 <li><?php the_time('M d, Y'); ?></li>
  86.                                                                 <li>|</li>
  87.                                                                 <li><?php the_category(', '); ?></li>
  88.                                                                 <li>|</li>
  89.                                                                 <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
  90.                                                         </ul>
  91.                                                 </div>
  92.                                                 <?php } ?>
  93.                         
  94.                             <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>
  95.                         
  96.                         <div class="clear"></div>
  97.                     
  98.                     <?php } ?>
  99.                                                                
  100.                 </div>
  101.                 <!-- end post -->
  102.             
  103.             <?php else: ?>
  104.                
  105.                 <!-- post -->
  106.                 <div class="post">
  107.                     
  108.                                         <h2<?php if(!of_get_option('showmeta')){ ?> class="postmargin"<?php } ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  109.                                         <?php if ( of_get_option('showmeta')) { ?>
  110.                                         <div class="post_meta">
  111.                                                 <ul>
  112.                                                         <li><?php the_time('M d, Y'); ?></li>
  113.                                                         <li>|</li>
  114.                                                         <li><?php the_category(', '); ?></li>
  115.                                                         <li>|</li>
  116.                                                         <li><?php comments_popup_link('Comments', '1 Comment', '% Comments'); ?></li>
  117.                                                 </ul>
  118.                                         </div>
  119.                                         <?php } ?>
  120.                     <?php if ( of_get_option('home_excerpt')) { ?>
  121.                                         <p><?php excerpt('300'); ?> <a href="<?php the_permalink(); ?>">Read More »</a></p>
  122.                                         <?php } else { ?>
  123.                                         <p><?php the_content(); ?></p>
  124.                                         <?php } ?>
  125.                
  126.                 </div>
  127.                 <!-- end post -->
  128.                
  129.             <?php endif; ?>
  130.                
  131.                 <?php endwhile; endif; ?>
  132.                
  133.                 <?php } ?>
  134.                
  135.                 <?php if ( !function_exists('dynamic_sidebar')
  136.                 || !dynamic_sidebar('Ad Position 8') ) : ?>
  137.                 <?php endif; ?>
  138.    
  139.     </div>
  140.     <!-- end leftcontent -->
  141.        
  142.         <?php if(of_get_option('site_layout') == '3c-l' || of_get_option('site_layout') == '3c-r'){ ?>
  143.         <div class="midcontent">
  144.                 <?php if ( !function_exists('dynamic_sidebar')
  145.                 || !dynamic_sidebar('Middle Column') ) : ?>
  146.                 <?php endif; ?>
  147.         </div>
  148.         <?php } ?>
  149.    
  150.         <?php get_footer(); ?>
复制代码
这个代码是不是有什么问题?应该怎么修改的呢?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-10-12 11:08:36 | 显示全部楼层

额,这个帖子我都不关注了.

空白应该是主题有些错误.

http://codex.wordpress.org/Debugging_in_WordPress#WP_DEBUG


加define('WP_DEBUG', true); 到 wp-config.php 看看


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|联系我们|Archiver|手机版|小黑屋|EEfaq论坛

GMT+8, 2024-4-29 10:49

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表