最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

problem with my my theme "search.php"

programmeradmin1浏览0评论

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 &

发布评论

评论列表(0)

  1. 暂无评论