Ability to link to Archive category page dynamically

Hi,

I am surprised we cannot found the links of archive pages of categories of products / cpt archive

We only have the possibility to set external URL which is not optimal if we change the URL (multilanguage website / manually modification of the slugs…etc)

Is it possible to add it to the road map ?

Thank you ! :slight_smile:

1 Like

Hey Joffrey,

try dynamic data and {echo:get_post_type_archive_link(your_cpt_slug)}.

Best,

André

2 Likes

thank you, however, it is related to my wooCommerce product category archive so the php function doesn’t seem to work :confused:

Hey Joffrey,

can you give a little more context? I’m sure there are ways… :slight_smile:

Best,

André

Hi @aslotta !

I found a solution with
function get_product_cat_url_by_slug($slug) {
$link = get_term_link($slug, ‘product_cat’);
return is_wp_error($link) ? ‘’ : $link;
}

and then call the function like
{echo:get_product_cat_url_by_slug(‘femme’)}

1 Like