Link to CPT Archive Page inside of Bricks

Bricks Version: 1.6.1
Browser: Chrome last version
OS: macOS

Inside of Bricks Builder and Button Link Type field:
How to link to CPT Default Archive Page?

1 Like

Can you not use an external link with the slug path to the template?

Sure, is easy and doable. But I wanted to know how to link dynamically to such pages …

3 Likes

This ever get picked up? Finding myself in the same boat, what about if anybody changes the slugs - all the instances will need updating?

My only work around unless Bricks comes back with a better way @aslotta :smiley:

{echo:get_post_type_archive_link(‘your-post-type’)}

2 Likes

This worked well for me, thank you very much!

1 Like

Did anyone end up finding a way? I tried using {echo:get_post_type_archive_link(‘your-post-type’)} but it doesnt work.

Probably because you need to add the function to your echo allowlist filter. Filter: bricks/code/echo_function_names – Bricks Academy

Still a good idea to add archive pages to the dropdown.

Can someone help me how and where to add the {echo:get_post_type_archive_link(‘your-post-type’)}? Thanks1

Here you go

Just make sure that the quotes are not the fancy inclined ones.

Just tried, with the correct quotes, but it doesn’t work. empty return.
the code is signed with bricks/code/echo_function_names also

For me it works with single quotes

{echo:get_post_type_archive_link('post')}

or without quotes

{echo:get_post_type_archive_link(post)}