wordpress : how to use a custom HTML file to creat

2019-09-09 15:29发布

问题:

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 ?

回答1:

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

I think this will solve your problem.



回答2:

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. :)



标签: wordpress