On my real estate website I add some environment taxonomies like "Mountain", "Sea", "City". (the slug of this one is "area")
I have other custom taxonomies.
I'd like to deactivate all custom taxonomies archives. I saw a few support posts about that but or it's hidden links or I can adapt it to my case.
Actually it's well redirected too a 404 page when I type hidden link
add_action('pre_get_posts', 'func_restrict_or_kill_taxonomy_archive_area');
function func_restrict_or_kill_taxonomy_archive_area($qry) {
if (is_admin()) return;
if (is_tax('area')){
$qry->set_404();
}
}
I created a search form with multiple selectors. One of them is a checkboxes list with these "area" criterias.
I'm happy you help me to deactivate the wordpress archives. Actually I'dlike to create a link in my menu going to my search page.
For the menu item "mountain" I'd like to preselect the attribute in order to display my general search view with "mountain" checkbox already checked so the user see only the items with the taxonomy "mountain" and have the other checkboxes unchecked. (so the user still have the possibility to make a different choice.
New threads created by Minesh and linked to this one are listed below: