Title: Dynamic CPT Generator
Author: Nancy
Published: <strong>2025 年 4 月 26 日</strong>
Last modified: 2026 年 10 月 5 日

---

搜索插件

![](https://ps.w.org/dynamic-cpt-generator/assets/banner-772x250.png?rev=3282456)

![](https://ps.w.org/dynamic-cpt-generator/assets/icon.svg?rev=3282470)

# Dynamic CPT Generator

 作者：[Nancy](https://profiles.wordpress.org/nancyarora3193/)

[下载](https://downloads.wordpress.org/plugin/dynamic-cpt-generator.3.0.0.zip)

 * [详情](https://cn.wordpress.org/plugins/dynamic-cpt-generator/#description)
 * [评价](https://cn.wordpress.org/plugins/dynamic-cpt-generator/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/dynamic-cpt-generator/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/dynamic-cpt-generator/#developers)

 [支持](https://wordpress.org/support/plugin/dynamic-cpt-generator/)

## 描述

**Dynamic CPT Generator** is a free, lightweight plugin that lets you create as 
many custom post types as you need, directly from a simple settings screen — no 
code, no config files, no developer required.

Every custom post type you create comes with its own shortcode, ready to drop into
any post, page, or widget to display your content in a polished **List**, **Grid**,
or **Carousel** layout.

#### Why use Dynamic CPT Generator?

 * **One-click creation** — type a name, pick a layout, click Create. Your custom
   post type is registered instantly, complete with its own admin menu, categories,
   and tags.
 * **Custom Field Builder** — add your own Text, Textarea, Number, URL, or Image
   fields to any custom post type, no code required. Fields show up as a metabox
   on the edit screen and automatically appear in the frontend display.
 * **Three built-in display layouts** — List, Grid, and a touch-friendly Carousel(
   powered by Slick Slider), switchable at any time without touching code.
 * **Shortcode-based output** — `[dcptg_display_dynamic_cpt type="yourchosenname"]`
   works anywhere shortcodes are supported, with optional `posts_per_page`, `orderby`,`
   order`, and `category` attributes.
 * **Gutenberg block** — add a “Dynamic CPT Display” block from the block inserter
   and configure it visually, no shortcode typing required.
 * **Built-in pagination** — set `posts_per_page` and visitors get automatic page-
   number navigation instead of one long list.
 * **Built-in Read More toggle** — visitors can expand full content inline without
   leaving the page.
 * **Categories & tags support** — every generated post type supports standard taxonomies
   out of the box.
 * **Lightweight & conditional loading** — styles and scripts only load on pages
   that actually use the shortcode or block, keeping your site fast.
 * **Safe cleanup** — manage or permanently delete a custom post type (and its posts)
   right from the settings screen.

#### Common use cases

Dynamic CPT Generator is a popular choice for building:

 * Portfolios and project showcases
 * Team member / staff directories
 * Testimonials and reviews
 * Products or services listings
 * Events and announcements
 * FAQs, case studies, and resource libraries

Use this shortcode anywhere on your site to display a custom post type:

    ```
    [dcptg_display_dynamic_cpt type="yourchosenname"]
    ```

Or filter and paginate the results:

    ```
    [dcptg_display_dynamic_cpt type="yourchosenname" posts_per_page="6" category="news" order="ASC"]
    ```

#### Customizing the design

Every layout is built from plain, documented CSS classes, so you can restyle the
output to match your site by adding CSS in **Appearance > Customize > Additional
CSS** (or your theme’s stylesheet) — no plugin files need editing, and your changes
survive plugin updates.

Container classes (one per layout, added to the shortcode/block wrapper):

 * `.dcp-cpt-list` — List layout
 * `.dcp-cpt-grid` — Grid layout
 * `.dcp-cpt-carousel` — Carousel layout

Classes inside every item, regardless of layout:

 * `.dcp-cpt-item` — the card/row wrapper for a single post
 * `.dcp-cpt-item img` — the featured image (`.dcp-no-image` is added when a post
   has no featured image)
 * `.dcp-excerpt` — the excerpt text
 * `.dcp-full-content` — the full content revealed by “Read More”
 * `.dcp-read-more` — the Read More / Show Less toggle link
 * `.dcp-cpt-fields` — the list of custom field values (if the post type has any)
 * `.dcp-cpt-pagination` — the pagination links (shown when `posts_per_page` is 
   set)

Example — make grid cards use your brand color for the Read More button:

    ```
    .dcp-cpt-grid .dcp-read-more { background: #111 !important; }
    ```

#### Building your own layout (Custom)

Need full control over the markup instead of just CSS? Pick **Custom** as the layout
for any post type, then open “Custom Template” in the settings screen and write 
your own HTML using these placeholders — no PHP required:

 * `{title}`, `{permalink}`, `{excerpt}`, `{content}` — the post’s own data
 * `{image}` — a ready-to-use `<img>` tag (or the built-in placeholder if there’s
   no featured image); `{image_url}` gives you just the URL if you want to build
   your own `<img>` tag
 * `{categories}`, `{tags}` — linked term lists
 * `{fields}` — every custom field for this post type, pre-formatted as a list
 * `{field:key}` — a single custom field’s value on its own (replace `key` with 
   the field’s name, lowercased)

Example template:

    ```
    <div class="my-card">{image}<h3>{title}</h3><p>{excerpt}</p><span>{field:price}</span></div>
    ```

If a post type is set to Custom but no template has been saved yet, the plugin automatically
falls back to its default card layout, so output is never broken.

## 区块

该插件提供了 1 个区块.

 *   Dynamic CPT Display

## 安装

 1. Go to **Plugins > Add New** in your WordPress dashboard.
 2. Search for **Dynamic CPT Generator**.
 3. Click **Install Now**, then click **Activate**.
 4. From the dashboard, go to **DCP CPT Generator**.
 5. Enter a name for your custom post type (lowercase letters, numbers, and underscores
    only).
 6. Choose a layout: **List**, **Grid**, or **Carousel**.
 7. Click **Create**.
 8. Use the shortcode `[dcptg_display_dynamic_cpt type="yourchosenname"]` to display
    your content.

## 常见问题

### Does this work with any WordPress theme?

Yes. Dynamic CPT Generator ships with its own self-contained styling for all three
layouts, so it works independently of your active theme. You’re also free to override
the included CSS classes to match your site.

### Can I create more than one custom post type?

Yes, there’s no limit. Each one gets its own unique name, admin menu, and shortcode.

### Will deleting a custom post type delete my content?

Deleting a custom post type from the settings screen permanently deletes all posts
created under it. You’ll be asked to confirm before anything is removed.

### Can I change the layout after creating a custom post type?

Yes. Use the “Update Layout” control next to any registered post type to switch 
between List, Grid, and Carousel at any time — no need to recreate it.

### Does the plugin slow down my site?

No. Carousel/List/Grid assets are only loaded on pages where the shortcode is actually
used, not site-wide.

### Does it support categories and tags?

Yes, every custom post type created with this plugin supports standard WordPress
categories and tags.

### Can I add custom fields to a post type?

Yes. Open “Manage Fields” under any registered post type and add Text, Textarea,
Number, URL, or Image fields. They’ll appear as a metabox when editing posts of 
that type, and automatically show up in the frontend output.

### Can I limit how many posts are shown, or paginate them?

Yes, use the `posts_per_page` shortcode attribute (or the block’s “Posts Per Page”
setting). When set, page-number navigation is added automatically.

### Do I need to use the shortcode, or is there a block?

Both are supported. Use the shortcode anywhere, or add the “Dynamic CPT Display”
block from the block inserter in the editor for a visual, no-code setup.

## 评价

![](https://secure.gravatar.com/avatar/b3c9d5418f221ca816384b906d0767a62bc16181afddb06c3f85ecc17221b02b?
s=60&d=retro&r=g)

### 󠀁[GREAT](https://wordpress.org/support/topic/great-17235/)󠁿

 [yourdeveloper412](https://profiles.wordpress.org/yourdeveloper412/) 2026 年 10
月 5 日

Great , saved lots of time

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/dynamic-cpt-generator/reviews/)

## 贡献者及开发者

「Dynamic CPT Generator」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Nancy ](https://profiles.wordpress.org/nancyarora3193/)
 *   [ pallavilimbasiya16 ](https://profiles.wordpress.org/pallavilimbasiya16/)

[帮助将「Dynamic CPT Generator」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/dynamic-cpt-generator)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/dynamic-cpt-generator/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/dynamic-cpt-generator/)，或通过[RSS](https://plugins.trac.wordpress.org/log/dynamic-cpt-generator/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/dynamic-cpt-generator/)。

## 更新日志

#### 3.0.0

 * Added: “Custom” layout option — write your own HTML template per post type using
   placeholders like `{title}`, `{image}`, `{fields}`, and `{field:key}`.
 * Improved: Settings screen’s own menu icon is now visually distinct from the icon
   used by each generated post type.

#### 2.2.0

 * Added: Custom Field Builder — add Text, Textarea, Number, URL, or Image fields
   to any custom post type, editable from a metabox and shown automatically on the
   frontend.
 * Added: New shortcode attributes `posts_per_page`, `orderby`, `order`, and `category`
   for filtering output.
 * Added: Automatic pagination when `posts_per_page` is set.
 * Added: “Dynamic CPT Display” Gutenberg block as a visual alternative to the shortcode.

#### 2.1.0

 * Added: Placeholder image for posts without a featured image.
 * Improved: Modernized admin settings screen with clearer sections, badges, and
   an empty-state message.
 * Improved: Styles and scripts now load only on pages that use the shortcode, instead
   of site-wide.
 * Fixed: Added nonce verification to the Delete and Update Layout actions.
 * Fixed: Custom post type names are now validated against WordPress’s naming rules
   and checked against reserved/core post type names.
 * Added: Clean-up of stored settings and generated posts on uninstall.

#### 1.0.0

 * Initial release.

## 额外信息

 *  版本 **3.0.0**
 *  最后更新：**1 月前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 5.7 或更高版本 **
 *  已测试的最高版本为 **7.1.4**
 *  PHP 版本 ** 7.2 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/dynamic-cpt-generator/)
 * 标签
 * [custom fields](https://cn.wordpress.org/plugins/tags/custom-fields/)[custom post type](https://cn.wordpress.org/plugins/tags/custom-post-type/)
   [shortcode](https://cn.wordpress.org/plugins/tags/shortcode/)
 *  [高级视图](https://cn.wordpress.org/plugins/dynamic-cpt-generator/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/dynamic-cpt-generator/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/dynamic-cpt-generator/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/dynamic-cpt-generator/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/dynamic-cpt-generator/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/dynamic-cpt-generator/reviews/?filter=1)

[您的评价](https://wordpress.org/support/plugin/dynamic-cpt-generator/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/dynamic-cpt-generator/reviews/)

## 贡献者

 *   [ Nancy ](https://profiles.wordpress.org/nancyarora3193/)
 *   [ pallavilimbasiya16 ](https://profiles.wordpress.org/pallavilimbasiya16/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/dynamic-cpt-generator/)