0

Whenever I am looking for information on how to handle pages, I always end up finding deprecated functions that link to the correct new functions. But those new functions are only documented in terms of how they work for manipulating posts. I have seen this page:

http://en.support.wordpress.com/post-vs-page/

but it is not very helpful when I am looking for answers like to questions like:

  • How should I get the content of a page?
  • What exactly is the title of the page; is it 'about' or 'About'? Or something else?
  • If I am using get_post how does it know if I am looking for a page or a post? Do pages and posts always have non-conflicting ids?
  • Can the WP_Post object also represent a page?

Answers to these questions would be helpful. A link to something that clearly illuminates this topic or an explanation would be even more helpful.

1 Answer 1

2

Behind the scenes, there really isn't much difference. Both are stored in the same table, along with some other Core and custom post types, so the IDs are globally unique, at least internally for the site, and yes, a page is a WP_Object just like a post.

The post_title, technically, is the human readable title. The post_name is a normalized-- lowercase with some characters stripped and spaces replaced with dashes-- slug and is used in things like permalinks.

The only big difference I can think of is that the "Page" post type does not have categories and tags, by default (but that can be enabled), and the "Post" post type does not have "Page Attributes"

I am sure I am probably missing something but I hope that helps.

Not the answer you're looking for? Browse other questions tagged or ask your own question.