WordPress.org

Forums

Search results - future (2 posts)

  1. jduffell
    Member
    Posted 3 years ago #

    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

  2. jduffell
    Member
    Posted 3 years ago #

    Anyone? going loopy with this one

Topic Closed

This topic has been closed to new replies.

About this Topic