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

plugins - How to prefix `attachment` permalinks with `attachment`?

programmeradmin2浏览0评论

Could you please help me to prefix attachment permalinks with a custom string (for example attachment)

Such that example/attachment-slug becomes example/attachment/slug?

  • Apply only to posts with post_type attachment
  • Using PHP that can be added to a custom plugin / mu-plugin / functions.php
  • Don’t worry about existing attachments – the code should alter the permalinks of new attachments

Thank you.

Kind regards, Mat

P.S. Related question here

发布评论

评论列表(0)

  1. 暂无评论