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

uploads - Organizing uploaded Media in permalink-based folder structure?

programmeradmin1浏览0评论

Wordpress seems to like storing files by year/month. This is nice, but not good enough for busy websites with loads of content. It'll be much nicer to have the folders reflect the exact same structure as the permalinks for them:

/wp-content/uploads/custom-post-type/category/postname-1.jpg
/wp-content/uploads/books/fiction/the-nun-1.jpg
/wp-content/uploads/books/romance/the-italian-spring.jpg

And so on. Is it possible to do this with some simple customized function in functions.php, or via some plugin?

Thanks for any pointers.

Wordpress seems to like storing files by year/month. This is nice, but not good enough for busy websites with loads of content. It'll be much nicer to have the folders reflect the exact same structure as the permalinks for them:

/wp-content/uploads/custom-post-type/category/postname-1.jpg
/wp-content/uploads/books/fiction/the-nun-1.jpg
/wp-content/uploads/books/romance/the-italian-spring.jpg

And so on. Is it possible to do this with some simple customized function in functions.php, or via some plugin?

Thanks for any pointers.

Share Improve this question asked Aug 25, 2019 at 13:12 Khom NazidKhom Nazid 17110 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

There is another thread discussing this, with multiple answers. You might check to see if they address your desires. They offer some code, and an available plugin solution.

发布评论

评论列表(0)

  1. 暂无评论