The get_post returns the post ID as an array ( $post->ID )
with multiple values. I nee开发者_运维问答d post id of particular post, how to extract this?
you are using the correct function for this: http://codex.wordpress.org/Function_Reference/get_post
if you were using get_posts(); , then that would return multiple ID's, but using get_post would only return an object or array containing a single post. e.g.:
<?php
$my_post_id = 20;
$my_post = get_post($my_post_id);
$title = $my_post->post_title;
?>
精彩评论