_x('Merk', 'taxonomy general name" /> _x('Merk', 'taxonomy general name" /> _x('Merk', 'taxonomy general name"/>

How to create custom taxonomy page? or custom archive page of custom taxonomy?

51 Views Asked by At

I am using WooCommerce plugin.

I have this custom taxonomy under a product called "Merk".

$labels = array(
    'name'                       => _x('Merk', 'taxonomy general name'),
    'singular_name'              => _x('Merk', 'taxonomy singular name'),
    'search_items'               => __('Search Merk'),
    // Add other labels as needed
);

$args = array(
    'hierarchical'          => true,
    'labels'                => $labels,
    'show_ui'               => true,
    'show_admin_column'     => true,
    'query_var'             => true,
    'rewrite'               => array('slug' => 'merk'),
    'public'                =>  true,
    'publicly_queryable'    =>  true,
    'has_archive'           =>  true
);

register_taxonomy('merk', 'product', $args);

Now I want to create an archive page of merk where I want to display all products from all terms under merk

I have tried creating by archive-merk and taxonomy-merk.php. no success.

I want to access that page by this URL https://www.example.com/shop/merk/

same for their term https://www.example.com/shop/merk/test

is there any way to do it?

0

There are 0 best solutions below