Methods → post
This property / method will either return the current post object, assign a new post as the current post or create and return a new post object if a post ID argument is given.
object atom()->post($post [, $setup_postdata = false])
- Post ID (an object can also be given)
- Sets up WP’s post globals to point to this post. If set to true,
resetCurrentPost()must be called after all operations on the current object are completed, so the original post gets restored.
// output the title of the post that has the ID 2 atom()->post(2)->Title(); // output the title of the current post atom()->post->Title();
Last revision 7 years