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

User role templates

programmeradmin3浏览0评论

I'm currently using the author.php template to display a frontend archive of users' posts from all roles. I've now created a new user role ("trainer") that needs to have a completely different frontend template to the other user roles.

My instinct was that I would be able to create a template with a naming convention like user-trainer.php or trainer.php that would only apply to users with the "trainer" role, but after looking through the Wordpress docs this does not appear to be a thing.

Does anyone have any suggestions on how I could achieve this other than just doing an if statement that checks the user role in author.php?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论