-1
wp_posts自定義查詢我創建了從WordPress的wp_posts自定義查詢,我需要知道,如果它的正確的,因爲我收到了此行的錯誤:在WordPress的
<li><a href="the_permalink()"> the_title() </a></li>
錯誤聽起來像這樣:解析錯誤:語法錯誤,意外'<'
好。我的代碼看起來是這樣的,我的意思是wp_posts我的「自定義」查詢:
$results=$wpdb->get_results("SELECT * FROM `wp_posts` WHERE post_title LIKE '%$name_query%' OR post_content LIKE '%$instit_query%' OR post_content LIKE '%$spec_query%' OR post_content LIKE '%$zone_query%' ORDER by post_title");
$myposts = get_posts($result);
foreach($result as $post) : setup_postdata($post);
<li><a href="the_permalink()"> the_title() </a></li>
endforeach;
wp_reset_postdata();
我不認爲會做我想做的事情,所以我需要一些幫助,請,我怎麼能顯示的職位,我在$ results變量中查詢?