archdexls主题游戏页面game-play.php有评论时,报错( ! ) Warning: printf(): Too few arguments in D:\wamp\www\wp-content\themes\arcadexls\games-play.php on line 97
( ! ) Warning: printf(): Too few arguments in D:\wamp\www\wp-content\themes\arcadexls\games-play.php on line 97
Call Stack
# Time Memory Function Location
1 0.0000 241656 {main}( ) ..\index.php:0
2 0.0000 244696 require( 'D:\wamp\www\wp-blog-header.php' ) ..\index.php:17
3 0.5254 33285248 require_once( 'D:\wamp\www\wp-includes\template-loader.php' ) ..\wp-blog-header.php:16
4 0.5254 33285336 do_action( ) ..\template-loader.php:12
5 0.5313 33304000 call_user_func_array:{D:\wamp\www\wp-includes\plugin.php:496} ( ) ..\plugin.php:496
6 0.5313 33304080 arcadexls_play_template_redirect( ) ..\plugin.php:496
7 0.5313 33304272 get_template_part( ) ..\template_redirect.php:118
8 0.5313 33305136 locate_template( ) ..\general-template.php:171
9 0.5313 33305320 load_template( ) ..\template.php:477
10 0.5313 33322456 require( 'D:\wamp\www\wp-content\themes\arcadexls\single-play.php' ) ..\template.php:503
11 0.7578 34129056 get_template_part( ) ..\single-play.php:8
12 0.7578 34129760 locate_template( ) ..\general-template.php:171
13 0.7578 34129880 load_template( ) ..\template.php:477
14 0.7578 34196248 require( 'D:\wamp\www\wp-content\themes\arcadexls\games-play.php' ) ..\template.php:503
15 0.8018 34206848 printf ( ) ..\games-play.php:97
第97行代码
<span class="iconb-date"><?php _e('Uploaded on:', MYAPB_THEMENAME); ?> <strong><?php echo get_the_date('d'); ?> <?php echo get_the_date('M'); ?> , <?php echo get_the_date('Y'); ?></strong></span> <span class="iconb-user"><?php _e('Uploader:', MYAPB_THEMENAME); ?> <a href="<?php echo get_author_posts_url($post->post_author); ?>"><?php the_author_meta('display_name',$post->post_author); ?></a></span> <span class="iconb-cate"><?php _e('Categories:', MYAPB_THEMENAME); ?> <?php echo get_the_category_list(', '); ?></span> <span class="iconb-comt"><?php printf( _n( 'Comments: <strong>%2$s</strong>', 'Comments: <strong>%1$s</strong>', get_comments_number(), MYAPB_THEMENAME),number_format_i18n( get_comments_number() )); ?></span> <?php echo get_the_tag_list('<span class="iconb-tags">'.__('Tags:', MYAPB_THEMENAME).' ', ', ','</span>'); ?>
其中显示评论及其条数的代码
<?php printf( _n( 'Comments: <strong>%2$s</strong>', 'Comments: <strong>%1$s</strong>', get_comments_number(), MYAPB_THEMENAME),number_format_i18n( get_comments_number() )); ?>
不是太懂,稍微查了一下,“如果 % 符号多于 arg 参数,则您必须使用占位符。占位符被插入 % 符号之后,由数字和 "\$" 组成。”
其中的"%1$s"和"%2$s"说占位符吧,少了\;说不是占位符吧,多了数字和$;搞不懂这里_n是做什么用的,也是一个函数,而且要四个参数?
<?php echo MYAPB_THEMENAME ?>的结果是arcadexls
<?php echo get_comments_number() ?>的结果是1
<?php echo _n( 'Comments: <strong>%2$s</strong>', 'Comments: <strong>%1$s</strong>', get_comments_number(), MYAPB_THEMENAME) ?>的结果是Comments: %2$s
<?php echo number_format_i18n( get_comments_number() ) ?>的结果是1
故最后printf()方法的实际调用为printf("%2$s", 1); 很明显这个应该是有问题的
将代码中的1$和2$都去掉,改为
<?php printf( _n( 'Comments: <strong>%s</strong>', 'Comments: <strong>%s</strong>', get_comments_number(), MYAPB_THEMENAME),number_format_i18n( get_comments_number() )); ?>
OK,至少可以解决眼下问题,虽然没完全弄明白!
archdexls主题游戏页面game-play.php有评论时,报错( ! ) Warning: printf(): Too few arguments in D:\wamp\www\wp-content\themes\arcadexls\games-play.php on line 97的更多相关文章
- [转]html页面调用js文件里的函数报错onclick is not defined处理方法
原文地址:http://blog.csdn.net/ywl570717586/article/details/53130863 今天处理html标签里的onclick功能的时候总是报错:Uncaugh ...
- html页面调用js文件里的函数报错-->方法名 is not defined处理方法
前几天写了一个时间函数setInterval,然后出现了这个错误:Uncaught ReferenceError: dosave is not defined(…) 找了半天都没发现错在哪,最后找到解 ...
- IE 页面不正常显示 错误脚本不报错 脚本调试相关
在开发时,有时自己做的页面上的JS有错误,但是IE浏览器并不报错,这个时候有可能是因为脚本调试被禁止了. 在Internet选项的高级里面有 两个禁止脚本调试选项,把他们去掉就行.
- vue打包后页面显示空白但是不报错
在使用vue打包的时候页面显示空白,并且控制台不报错 设置vue-router的时候mode设置为history模式了,这种模式要有后台的配合,一般还是使用哈希模式就不会出现页面空白了.
- archdexls主题设置每页显示游戏数目
archdexls主题,沒调整前,每页显示10个,这显然不够,尤其在搜狗浏览器上,由于这个主题只有触发下拉滚动条,才会自动在同一页面显示下一页,因此只显示10个甚至不能触发显示下一页这个动作. 原来设 ...
- slxna,游戏页面切到后台回来后返回sl页面导致sl页面无响应,解决方法。
slxna在wp7上表现很好,因为那会xna还是微软的亲儿子.但是到wp8时代,微软丢弃xna,不管不问了.但是丢之前没有把兼容搞的完美,以致有很多隐秘的坑,说不定就踩到了. 我这个游戏的sl页面用了 ...
- 查找jsp页面报错技巧
在报错跳转页面打印错误信息<div>系统执行发生错误,信息描述如下:</div> <div>错误状态代码是:${pageContext.errorData.stat ...
- centos7 安装nginx和php5.6.25遇到 无法访问php页面 报错file not found 问题解决
php-fpm安装完成,nginx安装完成 netstap -ntl| 发下端口正常开启 iptables -L 返现9000端口已经开放 ps -aux|grep nginx 发下nginx进程正常 ...
- Eclipse中新建WEB项目,JSP页面报错。
在Eclipse中新建java web项目,在JSP页面的第一行提示这个错误: [The superclass "javax.servlet.http.HttpServlet" w ...
随机推荐
- [Python]网络爬虫(七):Python中的正则表达式教程(转)
接下来准备用糗百做一个爬虫的小例子. 但是在这之前,先详细的整理一下Python中的正则表达式的相关内容. 正则表达式在Python爬虫中的作用就像是老师点名时用的花名册一样,是必不可少的神兵利器. ...
- WCF与WPF
1. WCF(Windows Communication Foundation )是一个统一的,可用于建立安全,可靠的面向服务的应用高效的开发平台.WCF是构建安全可靠的事务性服务的统一框架.它是一种 ...
- JMeter学习笔记--详解JMeter配置元件
JMeter配置元件可以用来初始化默认值和变量,以便后续采样器使用.将在其作用域的初始化阶段处理. CSV Data Set Config:被用来从文件中读取数据,并将它们拆分后存储到变量中,适合处理 ...
- AME_AME审批中子元素的概念和用途(概念)
2014-05-30 Created By BaoXinjian AME: Oracle Approvals Management AME的6个元素的概念和主要作用: Attribue -> ...
- 本地PC安装Centos 6.5 操作手册及遇到的问题
我采取的是使用U盘安装 一.准备工作 1.下载Centos6.5 ISO文件 我在官网上下的6.5版本CentOS-6.5-x86_64-bin-DVD1.iso, 由于CentOS-6.5-x86_ ...
- JavaScript:RegExp对象的使用(整理)
1. RegExp是什么? 对象表示正则表达式,它是对字符串执行模式匹配的强大工具. 2. 如何创建RegExp? 2.1 直接量语法 /pattern/attributes 2.2 创建RegExp ...
- svn导出历史版本
svn导出历史某一个版本,有时候想拷贝出项目某个版本的代码,又不希望覆盖现在的代码,需要用到导出历史版本 1.浏览历史版本 鼠标移到项目上右击显示: 2.选择显示日志,出现版本历史记录: 3.选 ...
- js正则匹配中文
alert(/[\u4e00-\u9fa5]{4}/.test("司徒正美"))//true alert(/[\u4e00-\u9fa5]{4}/.test("司正美&q ...
- CentOS7添加logstash5启动脚本
默认情况使用rpm包安装完logstash之后没有启动脚本,这一点我觉得算是开发不够彻底.官网给了一个脚本,需要根据不同的系统版本生成对应的启动脚本,而且官网没有给明使用方法,对于新用户来说算是个坑, ...
- ny55 懒省事的小明
懒省事的小明 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 小明很想吃果子,正好果园果子熟了.在果园里,小明已经将所有的果子打了下来,而 ...