带有“ post_title LIKE'something%'”的WP_Query?
我需要做一个WP_Query与LIKE上post_title。 我从这个常规开始WP_Query: $wp_query = new WP_Query( array ( 'post_type' => 'wp_exposants', 'posts_per_page' => '1', 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC', 'paged' => $paged ) ); 但是我实际上想要做的事情在SQL中看起来像这样: $query = " SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title LIKE '$param2%' AND $wpdb->posts.post_type = 'wp_exposants' ORDER BY $wpdb->posts.post_title "; $wpdb->get_results($query); 输出显示我期望的结果,但是我使用常规<?php …