WordPress.org

Support

Support » Themes and Templates » Search results – future

Search results – future

  • Hi,

    I’m searching through a custom post type using the following script which works perfectly for published posts.

    Although I’m now trying to alter this so that my search will only show scheduled post using post_status = future.

    Has anyone got any tips on how to adapt this.

    function SearchFilter($query) {
    if ($query->is_search or $query->is_feed) {
    $query->set('post_type', array('event'));
    }
    return $query;
    }
    add_filter('pre_get_posts','SearchFilter');

    cheers

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Search results – future’ is closed to new replies.