$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>custom post types - Can I manage current & past editions of an annual event with a single WordPress install?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

custom post types - Can I manage current & past editions of an annual event with a single WordPress install?

matteradmin9PV0评论

I want to use a single WP install to build a site that will present curent and pasts editions of an annual event.

From one year to the next the list of participants and the daily program change entirely. The data from both compose the archive. Other annual variables, like sponsors, don't need to be retained.

The configuration I settled upon is to create a participant custom post type and a program custom post type for each year: participants2019 and program2019, participants2020 and program2020, participants2021 and program2021, etc.

This allows me to add single posts and archive pages for the CPT for the current year and present past edition summaries on as single pages with custom templates. It makes it easy for the client to find where to edit the info in the Admin. The URLs are good and Polylang is happy with it. The client picks the "current" year via an options page.

So far this works pretty well and the goal of a small hosting footprint is achieved but is not quite optimal. For one it requires that I create the CPTs for future years in advance (I can't expect the client to know how to use the CPT UI plugin). I created an arbitrary 7 editions (2019 to 2025). It also adds a lot of items to the admin menu, which I solved (grouping and hiding) more or less with a plugin.

My question is twofold:
- is there a better configuration for this?
- if not, how can I let my client duplicate the current year's CPTs in order to create the CPTs for future edition in a dead simple way?

Post a comment

comment list (0)

  1. No comments so far