PHPackages                             n5s/page-for-custom-post-type - 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. n5s/page-for-custom-post-type

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

n5s/page-for-custom-post-type
=============================

Page for custom post types, just like page for posts

1.x-dev(1mo ago)83072[2 issues](https://github.com/nlemoine/page-for-custom-post-type/issues)[1 PRs](https://github.com/nlemoine/page-for-custom-post-type/pulls)GPL-3.0-or-laterPHPPHP ^8.2

Since Jun 16Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/nlemoine/page-for-custom-post-type)[ Packagist](https://packagist.org/packages/n5s/page-for-custom-post-type)[ Docs](https://github.com/nlemoine/page-for-custom-post-type)[ RSS](/packages/n5s-page-for-custom-post-type/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (5)Used By (0)

Page for custom post type
=========================

[](#page-for-custom-post-type)

WordPress custom post type archive are dynamically generated pages that can't really be edited.

If you dealed with it, you probably faced some recurring issues, among those:

- You might want to give your client the ability to add some content to that page (cover, title, excerpt, content, custom fields, etc.) just like any other page.
- You might want to customize SEO settings

There has been lots of efforts to circumvent this issues:

-
-
-
-

Although these plugins provided great inspiration to design this plugin, none of them were really satisfying.

Approach
--------

[](#approach)

This plugin tries to solve this problem by taking advantage of the native WordPress behavior, just like it does for the posts page. Which means (almost) no extra query or new function to get your page object.

In a posts page request (`show_on_front=page`, `page_for_posts={id}`), the `$wp_query` will contain both objects:

- `$wp_query->queried_object`: the custom post type archive page (`WP_Post`)
- `$wp_query->posts`: the custom post type posts (`WP_Post[]`)

The whole idea is to mimic this behavior for custom post types, hence the name.

Once activated, your custom post type will appear in Settings &gt; Reading admin page.

[![Capture d’écran 2023-06-16 à 12 01 40](https://private-user-images.githubusercontent.com/2526939/246384955-c725b560-ef7c-468e-9607-ef1617154c1c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwMTIyNDUsIm5iZiI6MTc3NTAxMTk0NSwicGF0aCI6Ii8yNTI2OTM5LzI0NjM4NDk1NS1jNzI1YjU2MC1lZjdjLTQ2OGUtOTYwNy1lZjE2MTcxNTRjMWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MDFUMDI1MjI1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTVkOWEzNWNjZjA1OGFkZGJkYjQyOTQ3ODE2OWMyMjQ5N2RjYTNhZTdjNzY1MjE3NzQ5NTJjNWM4M2MzNzY0MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.wppmSbTzVtJgBXMa4szbPwhA1NZP7rMvCTw4Ec2fb-U)](https://private-user-images.githubusercontent.com/2526939/246384955-c725b560-ef7c-468e-9607-ef1617154c1c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwMTIyNDUsIm5iZiI6MTc3NTAxMTk0NSwicGF0aCI6Ii8yNTI2OTM5LzI0NjM4NDk1NS1jNzI1YjU2MC1lZjdjLTQ2OGUtOTYwNy1lZjE2MTcxNTRjMWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MDFUMDI1MjI1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTVkOWEzNWNjZjA1OGFkZGJkYjQyOTQ3ODE2OWMyMjQ5N2RjYTNhZTdjNzY1MjE3NzQ5NTJjNWM4M2MzNzY0MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.wppmSbTzVtJgBXMa4szbPwhA1NZP7rMvCTw4Ec2fb-U)

Choose any page you want to set your page for custom post type.

Key differences with CPT archive
--------------------------------

[](#key-differences-with-cpt-archive)

CPT archiveHome for CPTConditionalsis\_post\_type\_archive = `true`
is\_archive = `true`is\_home = `true`
is\_$posttype\_page = `true`
is\_page\_for\_custom\_type = `$posttype`Queried object`WP_Post_Type``WP_Post`Template hierarchyarchive-$posttype.php
archive.php
index.phphome-$posttype.php
home.php
index.phpAPI
---

[](#api)

To be documented, in the meantime, check the `src/functions.php` file for getting an overview of available functions.

Integrations
------------

[](#integrations)

This plugin provides integrations with:

- ACF: add a new condition rule
- WordPress SEO
- Polylang

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance85

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62f16c9d375343e12eb02b2a3095dc9a02047287b5f12f75ef4c59929fcb2802?d=identicon)[n5s](/maintainers/n5s)

---

Top Contributors

[![nlemoine](https://avatars.githubusercontent.com/u/2526939?v=4)](https://github.com/nlemoine "nlemoine (49 commits)")

---

Tags

wordpresscustom-post-typecustom post type archivepage for custom post type

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/n5s-page-for-custom-post-type/health.svg)

```
[![Health](https://phpackages.com/badges/n5s-page-for-custom-post-type/health.svg)](https://phpackages.com/packages/n5s-page-for-custom-post-type)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[wpbp/cpt_columns

Improve the CPT list in the backend for your CPTs

218.3k](/packages/wpbp-cpt-columns)[bostondv/bootstrap-ninja-forms

Adds Bootstrap classes to Ninja Forms

222.2k](/packages/bostondv-bootstrap-ninja-forms)

PHPackages © 2026

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