WordPress.org

Ready to get started?Download WordPress

Forums

SearchAutocomplete
[resolved] Support for Relevanssi (4 posts)

  1. Flector
    Member
    Posted 11 months ago #

  2. Flector
    Member
    Posted 11 months ago #

    find solution, replace code:

    $tempPosts = get_posts( array(
    				's'           => $term,
    				'numberposts' => $this->options['autocomplete_numrows'],
    				'post_type'   => $this->options['autocomplete_posttypes'],
    			) );

    with

    if (function_exists("relevanssi_do_query") ) {
    			$query->query_vars['s'] = $term;
    			$query->query_vars['posts_per_page'] = $this->options['autocomplete_numrows'];
    			$query->query_vars['post_type'] = $this->options['autocomplete_posttypes'];
    			relevanssi_do_query($query);
    			$tempPosts = $query->posts;	}
    		else {
    			$tempPosts = get_posts( array(
    				's'           => $term,
    				'numberposts' => $this->options['autocomplete_numrows'],
    				'post_type'   => $this->options['autocomplete_posttypes'],
    			) );
    		}
  3. hereswhatidid
    Member
    Plugin Author

    Posted 11 months ago #

    I'll look at adding this in an upcoming release. Thanks for the code!

  4. jon509tech
    Member
    Posted 11 months ago #

    I'm using this code on one of my projects now, and it works great, thank you Flector!

Reply

You must log in to post.

About this Plugin

About this Topic