• DYLdev

    (@dyldev)


    Is there a way to get a custom taxonomy page to appear in a search result when the taxonomy term is searched for?

    For example, I have custom taxonomy called “product area,” and “lighting” is a term. So the url of that is somesite.com/product-area/lighting/. If someone searches for lighting, is there a way to get that link and page to show up in a search result?

    I’ve tried a couple plugins such as Relevanssi and Search Everything but neither appear to actually return the page itself as a search result.

    Would appreciate any help in this matter.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Since the results of a search are posts, it’s not feasible to include an archive link as part of the results, unless there’s a specific link post for each term.

    What you could do instead of link posts is alter the search result template to include a links section. Code can get the search terms from the ‘s’ query var of the global $wp_query object, if it exists. Use the search terms as a ‘name’ argument in get_terms(). If any terms are returned, output the links for each one.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Taxonomy page in Search results?’ is closed to new replies.