Archdexls Theme Game Page game-play.php There are comments, error (!) warning:printf (): Too few arguments in D:\wamp\www\wp-content\themes\arcadexls\games-play.php on line 97

Source: Internet
Author: User

( ! ) Warning:printf(): Too few arguments in D:\wamp\www\wp-content\themes\arcadexls\games-play.php on line 97Call Stack#Time Memory Function Location1 0.0000 241656 {main} (): \index.php:02 0.0000 244696require(' D:\wamp\www\wp-blog-header.php '). \index.php:173 0.5254 33285248require_once(' D:\wamp\www\wp-includes\template-loader.php '). \wp-blog-Header. php:164 0.5254 33285336 do_action ().. \template-loader.php:125 0.5313 33304000Call_user_func_array: {d:\wamp\www\wp-includes\plugin.php:496} (). \plugin.php:4966 0.5313 33304080 arcadexls_play_template_redirect (). \plugin.php:4967 0.5313 33304272 Get_template_part (). \template_redirect.php:1188 0.5313 33305136 locate_template (). \general-template.php:1719 0.5313 33305320 load_template (). \template.php:47710 0.5313 33322456require(' D:\wamp\www\wp-content\themes\arcadexls\single-play.php '). \template.php:50311 0.7578 34129056 Get_template_part (). \single-play.php:812 0.7578 34129760 locate_template (). \general-template.php:17113 0.7578 34129880 load_template (). \template.php:47714 0.7578 34196248require(' D:\wamp\www\wp-content\themes\arcadexls\games-play.php '). \template.php:50315 0.8018 34206848printf( )    .. \games-play.php:97

97th line of code

<spanclass= "Iconb-date" ><?php _e (' uploaded on: ', myapb_themename);?> <strong><?phpEchoGet_the_date (' d ');?> <?phpEchoGet_the_date (' M ');?>, <?phpEchoGet_the_date (' Y ');?></strong></span> <spanclass= "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> <spanclass= "Iconb-cate" ><?php _e (' Categories: ', myapb_themename);?> <?phpEchoGet_the_category_list (', ');?></span> <spanclass= "ICONB-COMT" ><?phpprintf(_n (' Comments: <strong>%2$s</strong> ', ' Comments: <strong>%1$s</strong> ', Get_comments_ Number (), myapb_themename), number_format_i18n (Get_comments_number ()));?></span> <?phpEchoGet_the_tag_list (' <span class= ' iconb-tags ' > '. __ (' Tags: ', myapb_themename). ' ', ', ', ' </span> ');?>

The code that displays the comment and its number of bars

printf (_n (' Comments: <strong>%2$s</strong> ', ' Comments: <strong>%1$s</strong> ', Get_comments_ Number (), myapb_themename), number_format_i18n (Get_comments_number ()));?>

Not too understanding, a little check, "if the% symbol is more than the arg parameter, you must use a placeholder." After the placeholder is inserted in the% symbol, it consists of a number and a "\$". ”

The "%1 $ s" and "%2$s" say the placeholder bar, less \; say not the placeholder bar, more numbers and $; do not understand what _n is doing here, but also a function, and to four parameters?

The result of <?php Echo Myapb_themename?> is Arcadexls

<?php Echo get_comments_number ()?> The result is 1

<?php echo _n (' Comments: <strong>%2$s</strong> ', ' Comments: <strong>%1$s</strong> ', get_ Comments_number (), myapb_themename)?> The result is comments: %2$s

<?php Echo number_format_i18n (Get_comments_number ())?> result is 1

So the actual invocation of the printf () method was printf ("%2$s", 1); Obviously, this is supposed to be a problem.

Remove the 1$ and 2$ from the code and change to

printf (_n (' Comments: <strong>%s</strong> ', ' Comments: <strong>%s</strong> ', Get_comments_number (), Myapb_themename), number_format_i18n (Get_comments_number ()));?>

OK, at least to solve the problem at the moment, although not fully understand!

Archdexls Theme Game Page game-play.php There are comments, error (!) warning:printf (): Too few arguments in D:\wamp\www\wp-content\themes\arcadexls\games-play.php on line 97

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.