0
我在我的wordpress网站example.com/download/
上有一个特定的页面,我已经有了一个页面。我想添加一些PHP代码来启用以下功能。WordPress有条件的固定链接
- 如果在
/download/<name>
后的子路径,我想获取基于<name>
- 某些目录中的文件如果没有指定子路径(
/download/
)我想显示已经写入 页面
这是可能与WordPress的挂钩/过滤器?
我有一种感觉它有事情做与WP_Rewrite类,但我不知道到底要写什么,也没有把它放在哪里没有WP或主题更新擦码
正是我在找的东西。谢谢 –
试图合并此。我收到一个错误'function custom_rewrite_rule(){add_rewrite_rule('^ download \ /([^ /] +)\ /?','/ wp-content/download_content/$ matches [1]','top'); } add_action('init','custom_rewrite_rule',10,0); 警告:无法修改标头信息 -/home/content/20中已经发送的标头(输出开始于/home/content/20/10282520/html/wp-content/themes/theme-child/functions.php:4) /10282520/html/wp-includes/pluggable.php 1203行# –
没关系。总的错字。多数民众赞成在深夜编程没有咖啡:) –