WordPress.org

Ready to get started?Download WordPress

Forums

Search Unleashed
"Search Unleashed" and Custom Post Types and Taxonomies (7 posts)

  1. bluebird2
    Member
    Posted 3 years ago #

    Does this plugin (Search Unleashed) support searching Custom Post Types and taxonomies?

    http://wordpress.org/extend/plugins/search-unleashed/

  2. alanna.scott
    Member
    Posted 3 years ago #

    i had the same question and was able to add a couple lines to /models/spider.php to add support for custom post types.

    right after this line (line 83):
    $this->blog_url = get_option( 'home' );

    add a line for each post type that looks like this:
    $this->post_sql .= " OR {$wpdb->posts}.post_type='customname1'";
    $this->post_sql .= " OR {$wpdb->posts}.post_type='customname2'";

    hope that helps!

  3. pixeline
    Member
    Posted 3 years ago #

    I further patched the plugin so that it would accomodate for the recently added post statuses, making it more compatible with WP3.1.

    So, in /models/spider.php right after line 78, add this line:

    $this->post_sql .= " AND {$wpdb->posts}.post_status NOT IN ('trash','future','inherit','pending','auto-draft')";
  4. Vegas Kev
    Member
    Posted 2 years ago #

    @pixeline: If I'm not mistaken, your patch would stop the search from displaying items in "trash", "pending" and "drafts". Is that correct?

  5. pixeline
    Member
    Posted 2 years ago #

    correct!

  6. Anthony Butler
    Member
    Posted 2 years ago #

    For those that are slow in the uptake - this fix works fine, but you have to re-index after updating it.

  7. krasentomov
    Member
    Posted 2 years ago #

    Thenk you for the great fix alanna.scott it worked like a charm for my custom post type.
    But now I have another problem - it simply doesn't work for custom taxonomies.
    Does someone know a fix for it too? It is crucial for me and I believe for many others. Too bad that the plugin haven't got any update for the last year and a half.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic