PHPackages                             timohubois/post-type-and-taxonomy-archive-pages - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. timohubois/post-type-and-taxonomy-archive-pages

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

timohubois/post-type-and-taxonomy-archive-pages
===============================================

Set the archive for your custom post types to associate them with a specific page and control the permalinks for single custom post type pages and custom taxonomies.

2.2.5(1w ago)727GPL-3.0-or-laterPHPPHP ^8.0CI passing

Since Jul 8Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/timohubois/post-type-archive-pages-and-permalink-settings)[ Packagist](https://packagist.org/packages/timohubois/post-type-and-taxonomy-archive-pages)[ RSS](/packages/timohubois-post-type-and-taxonomy-archive-pages/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (12)Versions (25)Used By (0)

Post Type and Taxonomy Archive Pages Settings
=============================================

[](#post-type-and-taxonomy-archive-pages-settings)

Post Type and Taxonomy Archive Pages Settings enables to select a page that should interact as archive for custom post types. It also enables to change the slug for custom post type single pages or custom taxonomies.

The Plugin extends the native **Reading** and **Permalinks** settings pages:

- Settings &gt; **Reading** &gt; Adds a section to select a page which should interact as archive for a custom post type.
- Settings &gt; **Permalinks** &gt; Adds a section to change the slug for custom post types and custom taxonomies.

How to programmatically get the post used as the archive page for a custom post type?
-------------------------------------------------------------------------------------

[](#how-to-programmatically-get-the-post-used-as-the-archive-page-for-a-custom-post-type)

Example how to retrieve the post object of the page set as the archive for a custom post type:

```
/**
 * Retrieves the post object for a given post type's archive page.
 *
 * @param string|null $postType The post type to retrieve the archive page for.
 * @return WP_Post|null WP_Post on success, or null on failure.
 */
function getCustomPostTypeArchivePage(?string $postType = null): ?\WP_Post
{
    $postType = $postType ?? getCurrentQueryPostType();

    if ($postType === null) {
        return null;
    }

    $postTypeObject = get_post_type_object($postType);

    if (!$postTypeObject || !$postTypeObject->has_archive) {
        return null;
    }

    $archiveSlug = $postTypeObject->has_archive;

    if (!is_string($archiveSlug)) {
        return null;
    }

    $archivePage = get_page_by_path($archiveSlug);

    return ($archivePage instanceof \WP_Post) ? $archivePage : null;
}

/**
 * Retrieves the current post type from the global $wp_query object.
 *
 * @return string|null The current post type, or null if not found.
 */
function getCurrentQueryPostType(): ?string
{
    global $wp_query;
    return $wp_query->query['post_type'] ?? null;
}

$archivePage = getCustomPostTypeArchivePage('your_custom_post_type');
if ($archivePage) {
    echo "Archive page title: " . $archivePage->post_title;
    echo "Archive page ID: " . $archivePage->ID;
    echo "Archive page URL: " . get_permalink($archivePage->ID);
} else {
    echo "No archive page found for this post type.";
}
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.0

Installation
------------

[](#installation)

1. Make sure you have the correct [requirements](#requirements).
2. Clone the repository and place it in `wp-content/plugins/` folder.

Development
-----------

[](#development)

1. Make sure you have the correct [requirements](#requirements).
2. Perform [Installation](#installation).
3. Run `composer i` to install composer dependency.

License
-------

[](#license)

GPLv3

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance94

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~71 days

Total

21

Last Release

7d ago

Major Versions

1.9.0.1 → 2.0.02025-05-02

PHP version history (2 changes)1.4PHP &gt;=8.0

1.6PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/082b8e18f406266b8525a63648a3d5bee68f69de2b18275aac15699cabc23513?d=identicon)[timo](/maintainers/timo)

---

Top Contributors

[![timohubois](https://avatars.githubusercontent.com/u/46505685?v=4)](https://github.com/timohubois "timohubois (143 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

wordpress-plugin

###  Code Quality

Static AnalysisRector

### Embed Badge

![Health badge](/badges/timohubois-post-type-and-taxonomy-archive-pages/health.svg)

```
[![Health](https://phpackages.com/badges/timohubois-post-type-and-taxonomy-archive-pages/health.svg)](https://phpackages.com/packages/timohubois-post-type-and-taxonomy-archive-pages)
```

###  Alternatives

[julien-c/iso3166

ISO 3166-1 alpha-2 mapping

652.6M2](/packages/julien-c-iso3166)[camspiers/statistical-classifier

A PHP implementation of Complement Naive Bayes and SVM statistical classifiers, including a structure for building other classifier, multiple data sources and multiple caching backends

17337.0k1](/packages/camspiers-statistical-classifier)[tapp/filament-google-autocomplete-field

Filament plugin that provides a Google Autocomplete field

30136.4k](/packages/tapp-filament-google-autocomplete-field)[symfony/ux-leaflet-map

Symfony UX Map Leaflet Bridge

14191.0k2](/packages/symfony-ux-leaflet-map)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
