sql - WordPress WP_Query - Can't query post_title -


i can't following code pass parameter return posts starting "jazz".

    <?php  $artist_post_title = 'jazz'     $args = array(     'post_type' => 'artists',     'post_title' => '%' . $artist_post_title );  ?>  <?php $user_query = new wp_query( $args); ?>   <?php if( $user_query->have_posts() ) : ?>     <?php while ( $user_query->have_posts() ) : $user_query->the_post(); ?>         <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />     <?php endwhile; ?>     <?php wp_reset_postdata(); // reset query ?> <?php endif; ?> 

i intrigued question, , did digging myself.

https://wordpress.stackexchange.com/questions/18703/wp-query-with-post-title-like-something

basically, defining filter wp_query can create precise result set.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -