I have a small problem with WP_Query
. I want to get the posts filtered by category and with similar project name (like query), so I'm trying this code:
$args=array(
'post_type' => 'post',
'post_status' => 'publish',
'category_name' => 'projects',
'name__like' => 'Proj');
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post();
echo '<div class="Entradas">'.get_the_title().'</div>';
endwhile;
}
wp_reset_query();
Actually it displays the projects filtered by category, but the name__like
is not working.
Any suggestions to fix this?
name__like
parameter is not supported by theWP_Query()
.