I need filter which change URL (archive)

[ad_1]

Hi everyone. I created listing website for companies with Crocoblock plugins. I created custom post type with 2 taxonomies (City and Industry).

How can I create listing page with filter and when you change filter option (City: New York) you go to another page ([example.com/city/new-york]) which is the same archive template (but has different title, list of companies and some text at the bottom)

It’s simple to just create archive pages and templates with that links ([example.com/city/new-york]) but I don’t know how can I connect filter with changing URL and go to different archive pages?

Who need explanation what is point of everything, it is SEO and UX. I need that every taxonomy has its own page which I want to be first at google for that keywords but when you change your mind and want to check other city or industry you go on the page with that title and text etc.

[ad_2]
1 Comment
  1. You can add following code snippet to **functions.php** file.

    ^(function change_archive_links() {)

    ^(global $wp_rewrite;)

    ^(// add ‘archive’)

    ^($wp_rewrite->date_structure =’blog/archive/%year%/%monthnum%/’;)

    ^(})

    ^(add_action(‘init’,’change_archive_links’);)

    Don’t forget to flush WordPress rewrite rules after adding the snippet. To do that, go to WP Dashboard > Settings > Permalinks and press Save Changes button.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer