[wordpress插件] Custom Post Type Multiroutes自定义帖子类型多路线

wordpress 插件 文章 2020-04-09 07:20 427 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

Custom Post Type Multiroutes allows you to manage, add, edit and update multiple routes for your Custom Post Types.

自定义帖子类型多路线允许您管理,添加,编辑和更新自定义帖子类型的多条路线。

Minimum configuration needed.

所需的最低配置。

Install it, type your routes for your posts and refresh permalinks.

安装它,为您的帖子输入路线并刷新永久链接。

Use case

用例

Say you have a custom post type called ‘Galleries’ and you want it to appear on two archive pages:

假设您有一个名为“画廊”的自定义帖子类型,并且希望它显示在两个存档页面上:

ews/gallery/

  / news / gallery /

/media/album/

/ media /专辑/

And its single pages to be: ews/gallery/ and /media/album/

及其单个页面为: / news / gallery / / media / album /

All you have to do is:

所有您需要做的是:

    1. Go to Settings > CPT Multiroutes (you will se a list of your custom post types)
    2. 转到“设置”>“ CPT多路径”(您将获得自定义帖子类型的列表)

    3. Click on “Add Route” for your ‘Galleries’ post.
    4. 点击“添加路线”以显示您的“画廊”帖子。

    5. Fill the new imput for that new route, in this case ‘news/gallery’
    6. 为该新路线填充新的估算值,在本例中为“新闻/图库”

    7. Repeat 2&3 per route you want to add.
    8. 要添加的每条路线重复2和3。

    9. Select the checkbox ‘Rewrite this post type archive to these routes’ if you want that route to be your archive page for the custom post type.
    10. 如果您希望该路线成为自定义帖子类型的存档页面,请选中“将此帖子类型的存档重写为这些路线”复选框。

    11. Click Save Routes.
    12. 点击保存路线。

    Additionally a custom Metabox will appear on each of those custom post types on its admin edit page, there you will be able to choose individually on which route you wish the post to be visible.

    此外,自定义Metabox将出现在其管理员编辑页面上的所有自定义帖子类型上,您可以在其中单独选择希望该帖子可见的路线。

    By default it will be visible on all defined routes.

    默认情况下,它将在所有已定义的路由上可见。

    If you are using WPML for multilanguage, when you add a route, an input for each acive language will appear so you can translate those new routes.

    如果您将WPML用于多语言,则在添加路线时,将出现每种有效语言的输入,以便您翻译这些新路线。

安装步骤

    1. Upload the entire Custom-Post-Type-Multiroutes folder to the /wp-content/plugins/ directory.
    2. 将整个 Custom-Post-Type-Multiroutes 文件夹上载到 / wp-content / plugins / 目录。

    3. Activate the plugin through the ‘Plugins’ menu in WordPress.
    4. 通过WordPress中的“插件”菜单激活插件。

下载地址
https://downloads.wordpress.org/plugin/custom-post-type-multiroutes.zip
-EOF-

AI助手支持GPT4.0