在WordPress中以自定义帖子类型更改基于URL重写的页面模板

时间:2018-12-23 14:23:32

标签: php wordpress

我已经创建了一个自定义帖子类型的作者,当它涉及单个作者的详细信息时,它运行良好。例如

http://localhost/author/james/

显示的是single-author.php文件。我的问题是,例如,我要在网址中的代理商名称旁边添加打印内容

http://localhost/author/james/print

如果url中有打印内容,则需要自动重定向到模板目录中存在的模板,即author-print.php

在wordpress中可以吗?

但是此答案仅适用于博客,但对于名为作者的自定义帖子类型则无效。https://wordpress.stackexchange.com/questions/137969/page-template-toggle-between-2-templates-2-permalinks-for-same-post

0 个答案:

没有答案