简体   繁体   English

如何使用静态HTML页面复制WordPress类别?

[英]How to replicate WordPress categories with static HTML pages?

I'm looking into converting my WordPress powered website into static HTML pages. 我正在考虑将由WordPress驱动的网站转换为静态HTML页面。 I'll just edit pages in eg Responsive Site Designer, Dreamweaver or SublimeText. 我将只在响应式网站设计器,Dreamweaver或SublimeText中编辑页面。

The only issue I have is how would I sort stuff in categories like I did in WordPress? 我唯一的问题是,如何像在WordPress中一样对类别进行分类? I could make a load of folders and sub folders but that is just plain madness. 我可以加载大量的文件夹和子文件夹,但这简直是疯狂。 Would love to know your thoughts on this. 很想知道您对此的想法。

Guess the same approach with categories could be also applied with tags. 猜测与类别相同的方法也可以应用于标签。

If possible I would like to skip using PHP. 如果可能的话,我想跳过使用PHP。

If you're talking about the URL structure of WordPress categories (eg www.website.com/category1/category2/post-title ), then yes you'll need to make your categories into directories. 如果您正在谈论WordPress类别的URL结构(例如www.website.com/category1/category2/post-title ),那么是的,您需要将类别放入目录中。

If you're talking about assigning categories to a given post/page, you can do this with PHP variables. 如果您正在谈论将类别分配给给定的帖子/页面,则可以使用PHP变量来实现。 When making your post, give it the variable that describe its categories. 在发布帖子时,给它提供描述其类别的变量。 Then you can call the posts where they are relevant to the category. 然后,您可以在与类别相关的地方调用帖子。

Then you can make a template such as "post-brief.php" that takes a snippet of the article an the title. 然后,您可以制作一个模板,例如“ post-brief.php”,该模板以文章的摘录作为标题。 Then you can make a category page that says get the post-brief.php of all variables in x category. 然后,您可以创建一个类别页面,该页面显示获取x类别中所有变量的post-brief.php。

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

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