Home >Web Front-end >HTML Tutorial >WordPress code to obtain page article content_html/css_WEB-ITnose
The following is the specific relevant page content calling code:
The code for wordpess to call a certain page content is as follows:
<?php$article_id = 1; //页面的IDecho get_post($article_id)->post_content;?>
post_author: (integer) the number of the article author
post_data: (Characters) The date and time the article was published (YYYY-MM-DD HH-MM-SS)
post_data_gmt: (Characters) The Greenwich Mean Time (GMT) the article was published (YYYY -MM-DD HH-MM-SS)
post_content: (Characters) Post content
post_title: (Characters) Post title
post_category: (Integer) Post category serial number. Note: This value is always 0 in versions after WordPress 2.1. You can use the get_the_category() function when defining the category of an article.
post_excerpt: (Characters) Post summary
post_status: (Characters) Post status (publish|pending|draft|private|static|object|attachment|inherit|future)
comment_status: (char) comment status (open|closed|registered_only)
ping_status: (char) pingback/trackback status (open|closed)
post_password: (char) post password
post_name: (Characters) URL nesting of the post
to_ping: (Characters) URL link to be quoted
pinged: (Characters) quoted link
post_modified: (Characters) The last modified time of the article (YYYY-MM-DD HH-MM-SS)
post_modified_gmt: (Characters) The last modified GMT time of the article (YYYY-MM-DD HH-MM-SS)
post_parent: (integer) Parent post number (for attachments, etc.)
guid: (Character) A link to the post. Note: You cannot use a GUID as a permanent link (although it was indeed treated as a permanent link in versions prior to 2.5), nor as an available link to an article. A GUID is a unique identifier that currently happens to be a link to an article.
post_type: (chars) (log | page | attachment)