我看过很多博客并尝试过,但我想要别的东西。
我试过的博文网址 -
localhost/post/how-to-include-category-title-in-blog
同样
localhost/post/how-to-create-php-script
常见的是post页-----
我需要那个 - 假设我的博客中有三个类别——PHP、HTML、CSS
我在每个类别中创建帖子 - 所以 URL 应该是 -
localhost/php/what-is-php
对于 CSS 帖子 -
localhost/css/what-is-css
用于 HTML 帖子
localhost/html/what-is-html
语法类似 -
localhost/category_name/post_title
类别应该与帖子相关。
我需要删除帖子并希望它动态显示。
localhost/post/how-to-create-php-script
帖子是博客中的一个页面。我希望它根据这些 URL 进行删除和管理 -
localhost/php/what-is-php
localhost/css/what-is-css
localhost/html/what-is-html
我正在研究 PHP 核心。
最佳答案
您想熟悉 WP 管理中的 Parmalinks 页面。这是来自 WP 的文档:https://wordpress.org/support/article/settings-permalinks-screen/
根据您的需要,您可能想尝试自定义永久链接配置,例如:
/%category%/%postname%/
关于php - 如何在 PHP 中管理博客文章 slug 标题之前的类别名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57206805/