简体   繁体   English

如何在 PHP 中的博客文章标题之前管理类别名称?

[英]How to manage category name before blog post slug title in PHP?

I have seen many blogs and tried but I want something another.我看过很多博客并尝试过,但我想要别的。

The blog post URL I've tried -我试过的博客文章网址 -

localhost/post/how-to-include-category-title-in-blog

same for同样的

localhost/post/how-to-create-php-script

There is the common thing is post page -----还有一个常见的就是post page -----

I need that - Suppose that I have three categories in my blog - PHP, HTML, CSS我需要 - 假设我的博客中有三个类别 - PHP、HTML、CSS

I create posts in every category - So the URL should be -我在每个类别中创建帖子 - 所以 URL 应该是 -

localhost/php/what-is-php 

for CSS posts -对于 CSS 帖子 -

localhost/css/what-is-css 

for HTML posts对于 HTML 帖子

localhost/html/what-is-html 

Syntax like -语法如 -

localhost/category_name/post_title 

The category should be related to the post.该类别应与帖子相关。

I need to remove the post and want it dynamic.我需要删除帖子并希望它是动态的。

localhost/post/how-to-create-php-script

the post is a page in the blog.帖子是博客中的一个页面。 I want it to remove and manage according to these URL -我希望它根据这些 URL 删除和管理 -

localhost/php/what-is-php 


localhost/css/what-is-css 



localhost/html/what-is-html

I am working on PHP core.我正在研究 PHP 核心。

You want to get familiar with the Parmalinks page in WP admin.您想熟悉 WP 管理中的 Parmalinks 页面。 Here is the documentation from WP: https://wordpress.org/support/article/settings-permalinks-screen/这是 WP 的文档: https : //wordpress.org/support/article/settings-permalinks-screen/

For your need you probably want to try a custom permalink config like:根据您的需要,您可能想尝试自定义永久链接配置,例如:

/%category%/%postname%/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM