Skip Navigation

[Resolved] Date Archive

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by robina-2 4 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1403313

I have a CPT that I would like to use date archives on (i.e., site.com/2019/12/my-post) but for the primary post type I need it to be set to post name (i.e., site.com/my-post).

In Settings > Permalinks the site is set to post name. This correctly output the URL for my posts. But for my custom posts, I don't get the date archive feature.

What I am trying to figure out is how do I enable the date archive feature of just one post type?

#1403703

Hello,

There isn't such kind of built-in feature within Toolset Types plugin, Types plugin is using WordPress function register_post_type() to create new post types, see WordPress document:
https://codex.wordpress.org/Function_Reference/register_post_type#rewrite
slug' => string Customize the permalink structure slug. Defaults to the $post_type value

By default, you can setup only static text for post type rewrite rule.

And you might consider custom codes, for example add your custom rewrite rule using WordPress filter hook:
https://codex.wordpress.org/Function_Reference/add_rewrite_rule

#1404811

My issue is resolved now. Thank you!