开发者

Where does WordPress store HTML pages?

I'm new to WordPress, but I've been experimenting with it and I like it.

开发者_JAVA技巧

So, I'm moving my current site--mostly static HTML files--over to WordPress. My procedure, generally, has been to create new pages in WordPress and then copy the relevant body HTML from my files to WordPress. I'm curious, though, where does WordPress store these pages?

Where are the file(s) containing the HTML? ... It would be nice to be able to work with the pages someplace other than the tiny editor built into WordPress's dashboard.


They are in WordPress's database, specifically the wp_posts table, so unfortunately you have to use the admin console editor to change their content.

Update: Another option would be to use the WordPress API to make changes to the content.


If you prefer working with the HTML instead of the small editor within the Add new Posts / Pages site you can (as a temporary solution) create custom templates for each of your pages just to migrate quickly to WordPress. Afterwards, once that is done, you can create your custom theme and then place this bit of PHP code at the top of each page:

<?php
    /**
    *
    * @package WordPress
    * @subpackage THEME_NAME
    *
    */

    /*
        Template Name: THE PAGE NAME
    */
?>

Afterwards, just add a new page and select the template. You don’t need to fill out anything in the WordPress administrator page. Once that is done and you get the hang of all of the APIs in WordPress you can properly build your theme so when editing / creating new pages, the HTML is generated automatically. It's a long way around, but it can help you understand how WordPress works. There is a lot of documentation on the wordpres.org website.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜