$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>problem with my my theme "search.php"|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

problem with my my theme "search.php"

matteradmin12PV0评论

when I try to search something it shows me that I have an error in line 9

The code on line 9 on my page "search.php" of my theme

<div class="p-title"><h2 style="background-color: #1AB3EE;">Searching for <?php $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(''); _e('<strong class="terms_search">'); echo $key; _e('</strong>'); _e(' - About '); echo $count . ' '; _e('results'); wp_reset_query(); ?></h2></div>

The error message

when I try to search something it shows me that I have an error in line 9

The code on line 9 on my page "search.php" of my theme

<div class="p-title"><h2 style="background-color: #1AB3EE;">Searching for <?php $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(''); _e('<strong class="terms_search">'); echo $key; _e('</strong>'); _e(' - About '); echo $count . ' '; _e('results'); wp_reset_query(); ?></h2></div>

The error message

Share Improve this question asked Mar 23, 2019 at 13:17 Ol MimudOl Mimud 31 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 3

Using &new in object creation is deprecated in PHP 7+ because objects are passed by be reference by default. Remove the &

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far