WordPress 中的自定义动态路由 | Timber Routes::load() 返回 404

问题描述

我已经使用 Timber 设置了自定义路由,页面加载并显示正常,但应用的是 404 模板,而不是 Routes::load() 中给出的模板。

有一些关于 this Github post 路由已被弃用的讨论。现在怎么办?如何重新利用现有的 Timber 路由代码以使用新方法

路由代码结构示例:

Routes::map('members/events/:category_name',function($params){

    // ...large amount of code here to alter params and prepare the query

    if (in_array($category,$countyCatsSlugs)) {
        Routes::load('page-events.PHP',$params,$query,200);
    }
});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)