Dynamic Content - custom post type archive url

Is it possible to use dynamic content to generate the url for a custom post type archive?

The only options I see in Cornerstone are the current archive {{dc:archive:url}} and a specific term archive {{dc:archive:url term="1"}}, but neither of those will give me a custom post type archive page. It’s a little confusing because, in the Dynamic Content options, there is a section for “Term” and a section for “Archive”, but I’m not sure what he difference between these two is, if they both can only return term archives.

Let me know if I’m missing something.

Hello @adaptifyDesigns,

Thanks for posting in!

The “Archive” dynamic content can be used when you are creating a custom archive layout.

The “Term” dynamic content can be used in a Looper Consumer to display the terms of reach return post/custom post type items. It is unlikely that you need to display or return the custom post type URL. Can you please provide us a little more clarification on what you are trying to do? Perhaps, a link or access to your site so that we can check your layout and its settings.

Best Regards.

I have a button on my home page that links to the the custom post type archive page for a custom post type called “work”. The reason I would rather use dynamic content to generate this link is the same reason I would prefer to use a wordpress function to generate any kind of page link, so that if anyone decides to change the CPT archive slug in the future, then the link would still contain the correct url.

If that’s not possible with Cornerstone then I’ll just hardcode the URL. But it would be nice to be able to use the Dynamic Content this way, to programmatically generate urls and avoid hardcoding wherever possible as a best practice.

Thanks!

Hi @adaptifyDesigns,

Regretfully, there’s no such dynamic content that will programmatically generate URLs based on the archive page of the post type. I suggest that you just manually added the URL to your homepage button.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.