The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress custom post type search not filtering search based on input

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #162588
    Josh Johnson

    If you go to:

    At the moment I am using the following query in my search.php file:

    $args = array( 
        'post_type' => 'centre', 
        'paged' => $paged,
        'orderby' => 'title',
        'order' => 'ASC',
        'posts_per_page' => 6, //Limits the amount of posts on each page
        'post_title' => 'LIKE %'.$_POST['s'].'%' 
    $loop = new WP_Query( $args ); 

    At the moment if you search anything, the results page shows just first 6 posts of the post type ‘centre’. I’m using a while ( $loop->have_posts() ) : $loop->the_post(); loop to filter results.

    Any ideas?

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.