{"id":13759562,"url":"https://github.com/cedaro/cpt-archives","last_synced_at":"2025-10-20T02:39:11.701Z","repository":{"id":6725750,"uuid":"7971599","full_name":"cedaro/cpt-archives","owner":"cedaro","description":"A WordPress plugin to manage post type archive titles, descriptions, and permalink slugs from the dashboard.","archived":false,"fork":false,"pushed_at":"2016-07-27T16:18:20.000Z","size":144,"stargazers_count":44,"open_issues_count":7,"forks_count":7,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2024-08-03T13:03:29.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cedaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-02T04:33:05.000Z","updated_at":"2023-02-10T15:53:54.000Z","dependencies_parsed_at":"2022-09-08T14:11:54.778Z","dependency_job_id":null,"html_url":"https://github.com/cedaro/cpt-archives","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fcpt-archives","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fcpt-archives/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fcpt-archives/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fcpt-archives/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedaro","download_url":"https://codeload.github.com/cedaro/cpt-archives/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224941038,"owners_count":17395813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T13:00:55.455Z","updated_at":"2025-10-20T02:39:11.621Z","avatar_url":"https://github.com/cedaro.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# CPT Archives [![Build Status](https://travis-ci.org/cedaro/cpt-archives.png?branch=develop)](https://travis-ci.org/cedaro/cpt-archives)\n\nA WordPress plugin to manage post type archive titles, descriptions, and permalink slugs from the dashboard.\n\n__Contributors:__ [Brady Vercher](https://twitter.com/bradyvercher)  \n__Requires:__ WordPress 4.0+ \u0026 PHP 5.4+  \n__License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)\n\n\n## Description\n\n*CPT Archives* allows for editing a post type's archive properties by registering a new `cpt_archive` custom post type that's connected to the post type (that's a mind bender). In fact, since it's really nothing more than a CPT, it can be further extended with plugins to add meta boxes for customizing your archive pages in new and interesting ways. By default, archive titles, descriptions and permalinks can be managed through a familiar interface.\n\nAnother benefit is that a new \"Archive\" section appears on the *Appearance \u0026rarr; Menus* screen, making it easy to add your post type archives to a menu without using a custom link. Even if your archive slug is changed, you won't have to update the URL in your menu.\n\n![Edit Archive Screen Screenshot](screenshot-1.png)  \n_Example of an Edit Archive screen. The archive title, description and permalinks can all be updated._\n\n\n## Usage\n\nTo register archive support for an existing post type, add a quick snippet to your theme's `functions.php` file or in a custom plugin like this:\n\n```php\nadd_action( 'init', function() {\n\tadd_post_type_support( 'my_post_type', 'archive' );\n} );\n```\n\nThis automatically adds a submenu in the post type's menu that points directly to the archive edit screen. Behind the scenes, when you register support for an archive this way, a new `cpt_archive` post is created and connected to the post type, so you don't have to do anything else.\n\n\n### Advanced Registration\n\nFor more control, an alternative API is available for registering archives:\n\n```php\nadd_action( 'init', function() {\n\tif ( empty( $GLOBALS['cptarchives'] ) ) {\n\t\treturn;\n\t}\n\n\t$GLOBALS['cptarchives']-\u003eregister_archive( 'my_post_type', array(\n\t\t'customize_rewrites' =\u003e true,\n\t\t'show_in_menu'       =\u003e true,\n\t\t'supports'           =\u003e array( 'title', 'editor', 'thumbnail' ),\n\t) );\n} );\n```\n\n\u003ctable\u003e\u003ccaption\u003e\u003ch3\u003eArchive Registration Arguments\u003c/strong\u003e\u003c/h3\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eArgument\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cstrong\u003e\u003ccode\u003ecustomize_rewrites\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd\u003eWhether the post type's rewrites can be customized. Defaults to \u003ccode\u003etrue\u003c/code\u003e. Accepts \u003ccode\u003efalse\u003c/code\u003e, \u003ccode\u003e'archives'\u003c/code\u003e, and \u003ccode\u003e'posts'\u003c/code\u003e.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cstrong\u003e\u003ccode\u003eshow_in_menu\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd\u003eWhether the archive should be added to the admin menu. Defaults to \u003ccode\u003etrue\u003c/code\u003e. Also accepts a top level menu item id.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cstrong\u003e\u003ccode\u003esupports\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd\u003eA list of \u003ca href=\"http://codex.wordpress.org/Function_Reference/add_post_type_support\"\u003epost type features\u003c/a\u003e that should be enabled on the archive edit screen.\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n### Post Type Archive Templates\n\n_CPT Archives_ works with default archive template tags. Additional data for the archive post object can be retrieved using the `$cptarchives` global (be sure it exists before using it).\n\nThe `archive-my_post_type.php` template for the example CPT registered above could look something like this:\n\n```php\n\u003c?php get_header(); ?\u003e\n\n\u003c?php the_archive_title( '\u003ch1 class=\"archive-title\"\u003e', '\u003c/h1\u003e' ); ?\u003e\n\n\u003c?php the_archive_description( '\u003cdiv class=\"archive-description\"\u003e', '\u003c/div\u003e' ); ?\u003e\n\n\u003cfigure class=\"archive-featured-image\"\u003e\n  \u003c?php echo get_the_post_thumbnail( $cptarchives-\u003eget_archive_id() ); ?\u003e\n\u003c/figure\u003e\n\n\u003cdiv class=\"archive-meta\"\u003e\n  \u003c?php echo $cptarchives-\u003eget_archive_meta( 'meta_key', true ); ?\u003e\n\u003c/div\u003e\n\n\u003c?php while ( have_posts() ) : the_post(); ?\u003e\n  \u003c?php get_template_part( 'content' ); ?\u003e\n\u003c?php endwhile; ?\u003e\n\n\u003c?php get_footer(); ?\u003e\n```\n\n\n## Installation\n\n### Upload\n\n1. Download the [latest release](https://github.com/cedaro/cpt-archives/archive/master.zip) from GitHub.\n2. Go to the _Plugins \u0026rarr; Add New_ screen in your WordPress admin panel and click the __Upload__ button at the top next to the \"Add Plugins\" title.\n3. Upload the zipped archive.\n4. Click the __Activate Plugin__ link after installation completes.\n\n### Manual\n\n1. Download the [latest release](https://github.com/cedaro/cpt-archives/archive/master.zip) from GitHub.\n2. Unzip the archive.\n3. Copy the folder to `/wp-content/plugins/`.\n4. Go to the _Plugins \u0026rarr; Installed Plugins_ screen in your WordPress admin panel and click the __Activate__ link under the _CPT Archives_ item.\n\nRead the Codex for more information about [installing plugins manually](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).\n\n### Git\n\nClone this repository in `/wp-content/plugins/`:\n\n`git clone git@github.com:cedaro/cpt-archives.git`\n\nThen go to the _Plugins \u0026rarr; Installed Plugins_ screen in your WordPress admin panel and click the __Activate__ link under the _CPT Archives_ item.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedaro%2Fcpt-archives","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedaro%2Fcpt-archives","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedaro%2Fcpt-archives/lists"}