最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Add custom template 'sub-page' to Custom Post type?

programmeradmin0浏览0评论

I have a custom post type called 'Inspections'

Doing this, you can access an inspection record by going to example/inspections/inspection-slug-here

However, I want to add some 'sub-pages' if you will:

/inspections/<inspection-slug-here>/sub-page1
/inspections/<inspection-slug-here>/sub-page2

In this case, I would really like sub-page1 and sub-page2 to be templates that I can author in elementor, or something similar.

In a perfect scenario, I would like to pass the details of the parent (inspection-slug-here) to be loaded in this sub section so I can use custom fields or something of the likes.

Is there anything out there that does this? I am using elementor and an elementor templates tool, but cannot find any ways to do what i want.

Thanks!

I have a custom post type called 'Inspections'

Doing this, you can access an inspection record by going to example/inspections/inspection-slug-here

However, I want to add some 'sub-pages' if you will:

/inspections/<inspection-slug-here>/sub-page1
/inspections/<inspection-slug-here>/sub-page2

In this case, I would really like sub-page1 and sub-page2 to be templates that I can author in elementor, or something similar.

In a perfect scenario, I would like to pass the details of the parent (inspection-slug-here) to be loaded in this sub section so I can use custom fields or something of the likes.

Is there anything out there that does this? I am using elementor and an elementor templates tool, but cannot find any ways to do what i want.

Thanks!

Share Improve this question asked May 14, 2020 at 6:21 Barry ChapmanBarry Chapman 816 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 0

If you are interested in using Plugin, and to add PHP code directly into your Elementor, try the following plugin which will enable to add PHP code directly into your Elementor pages.

https://wordpress/plugins/php-everywhere/

You can create a custom Single template and when saving it, set the display conditions to the posts you want.

发布评论

评论列表(0)

  1. 暂无评论