WordPress.org

Support

Support » Plugins and Hacks » "Search Unleashed" and Custom Post Types and Taxonomies

"Search Unleashed" and Custom Post Types and Taxonomies

Viewing 6 replies - 1 through 6 (of 6 total)
  • 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!

    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')";

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

    correct!

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

    krasentomov

    @krasentomov

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘"Search Unleashed" and Custom Post Types and Taxonomies’ is closed to new replies.