Get the App
SLTechnology News&Howtos  ›  Servers  › 

Wordpress gets a brief introduction to the title of the article through the ID of the current article

Shulou Source: shulou.com Published: 2022-06-02 05:05:39 10月01日 Update

Editor to share with you wordpress through the ID of the current article to get a brief introduction to the title of the article, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

How does wordpress get a brief introduction to the title of the article through the ID of the current article?

Wordpress uses a lot of information to get the information of the article through the ID of the current article. In the secondary development of wordpress, the last article said, get the id of the current article and the number of comments on the current article. In fact, as long as you get the id of the current article, you can get a lot of information!

The code is as follows:

The information that can be obtained through get_post ($id)-> is:

Post_author: (integer) the number of the author of the article

Post_data: (character) date and time the article was published (YYYY-MM-DD HH-MM-SS)

Post_data_gmt: (character) Greenwich mean time (GMT) (YYYY-MM-DD HH-MM-SS) of the article published

Post_content: (character) content of the article

Post_title: (character) title of the article

Post_category: (integer) the number of the article category. Note: this value is always 0 after WordPress 2.1s. You can use the get_the_category () function when defining the categories of articles.

Post_excerpt: (character) article summary

Post_status: (character) Article status (publish | pending | draft | private | static | object | attachment | inherit | future)

Comment_status: (character) comment status (open | closed | registered_only)

Ping_status: (character) pingback/trackback status (open | closed)

Post_password: (character) article password

Post_name: (character) URL nesting of articles

To_ping: (character) URL link to be referenced

Pinged: (character) referenced link

Post_modified: (character) the last modification time of the article (YYYY-MM-DD HH-MM-SS)

Post_modified_gmt: (character) the last modified GMT time of the article (YYYY-MM-DD HH-MM-SS)

Post_parent: (integer) parent article number (for attachment, etc.)

Guid: (character) A link to an article. Note: GUID cannot be used as a permanent link (although it was treated as a permanent link in versions prior to 2.5), nor can it be used as an available link to an article. GUID is a unique identifier that just happens to be a link to the article right now.

Post_type: (characters) (log | page | attachment)

Post_mime_type: (character) Mime type (for attachments, etc.)

Comment_count: (integer) Total number of comments

The above is all the contents of the brief introduction of the article title obtained by wordpress through the ID of the current article. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Article character link content title integer comment content introduction introduction information time status attachment version article category permanent previous article not much code Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno Linux Shulou Information MariaDB