admin管理员组文章数量:1130349
I used to have an archive-rooms.php (as page-rooms.php) template to list them all
This had few problems:
- No title page
- No way to synch menu item with title
so:
1) I duplicated the archive-rooms and prepended to it:
<?php
/*
Template Name: Rooms Template
*/
?>
2) Created page, assigned the template and set the slug from the post type to the page
3) Removed has_archive from the register_post_type() arguments
Now the problem, when I open the page the content is not what I expected, expecially the class of the body:
<body class="blog">
Which something like this I was expecting:
<body class="page page-id-xx page-template-rooms etc..">
Any explanation/suggestion for this issue?
Thanks
I used to have an archive-rooms.php (as page-rooms.php) template to list them all
This had few problems:
- No title page
- No way to synch menu item with title
so:
1) I duplicated the archive-rooms and prepended to it:
<?php
/*
Template Name: Rooms Template
*/
?>
2) Created page, assigned the template and set the slug from the post type to the page
3) Removed has_archive from the register_post_type() arguments
Now the problem, when I open the page the content is not what I expected, expecially the class of the body:
<body class="blog">
Which something like this I was expecting:
<body class="page page-id-xx page-template-rooms etc..">
Any explanation/suggestion for this issue?
Thanks
本文标签: custom post typesTurning archive templates to a page template maintaining the slug
版权声明:本文标题:custom post types - Turning archive templates to a page template maintaining the slug 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749150800a2323770.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论