wordpress : how to use a custom HTML file to creat

2019-09-09 15:33发布

I have generated pages using a custom template by creating a php file in

 /wp-content/themes

something like :

<?php
 *
 * Template Name: Contact Page
 */
 ?>
 <html ..... </html>

and then adding a new page on the dashboard selecting this new template

The problem is i cannot associate tags and categories to each pages. i would need apparently instead to create posts. How could i then create posts from a custom html file ?

标签: wordpress
2条回答
放我归山
2楼-- · 2019-09-09 15:54

Use custom post types and create a single-{posttype}.php

I think this will solve your problem.

查看更多
欢心
3楼-- · 2019-09-09 16:10

Custom post types are exactly what you need. Essentially, they're custom content containers and an extensible version of default posts. They can be associated with tags and categories just like normal posts can.

You can find implementation instructions here. :)

查看更多
登录 后发表回答