1

The param name is s not search. So your query ignores the search param and returns all cpts. And your $_GET input should be sanitized before use. 's' => sanitize_text_field( $_GET['q'] ),


1

By default, WordPress disallow 2 identical slugs because if you change your permalink structure for custom structure, you should be able to have in your case: https://example.com/saint-louis/ https://example.com/saint-louis/ And you can understand, it's impossible. The only way is checking by code, you are not in "custom structure" and then save ...


1

I think I solved my problem. So if you have your WordPress post permalink set to %category%/%postname%/, and you want this for custom post type and taxonomy, you could prepare your rewrite links for all generated taxonomy terms (cat-a, cat-b etc.). Code: add_filter( 'rewrite_rules_array', function($rules) { $categories = get_terms(['taxonomy' => '...


Only top voted, non community-wiki answers of a minimum length are eligible