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

enter image description here

1 Answer 1

3

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

1
  • thank you so much! that solved my problem :)
    – Ol Mimud
    Commented Mar 23, 2019 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.