• Hello Guys,

    I’m trying to implement a new search option in store locator plugin.

    I needed to add a custom taxonomy and I was successful with it but now I need it to work with the search system.

    I have this SQL Query, which the plugin dev pointed me at, but I don’t know much about SQL so I’m asking for your help.

    $cat_filter = "INNER JOIN $wpdb->term_relationships AS term_rel ON posts.ID = term_rel.object_id
                                   INNER JOIN $wpdb->term_taxonomy AS term_tax ON term_rel.term_taxonomy_id = term_tax.term_taxonomy_id
                                          AND term_tax.taxonomy = 'wpsl_store_category'
                                          AND term_tax.term_id = %d";

    Here I need to add the option of also search by my new custom taxonomy, which is called wpsl_custom_category.

    I already tried adding by duplicating
    AND term_tax.taxonomy = ‘wpsl_custom_category’
    but then neither of the search fields work.

    Can you please help me with this?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding a custom taxonomy to a SQL Query’ is closed to new replies.