I found the following codes to get post details. However, it is not possible to get the posts by content. Does any one has any ideas?
get_posts()
//// get post ////
$args = array(
'numberposts' => -1, // number of posts to display; display all: -1.
'offset' => 0,
// 'category' => , // post category ID
'orderby' => 'post_date',
'order' => 'DESC', // Latest post first: 'ASC'; Olderest post first: 'DESC'
// 'include' => ,
// 'exclude' => ,
// 'meta_key' => ,
// 'meta_value' => ,
'post_type' => 'post', // get post type
// 'post_mime_type' => ,
// 'post_parent' => ,
// 'post_status' => 'publish'
);
// http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
$posts_array = get_posts( $args );
foreach( $posts_array as $post ) : setup_postdata($post);
echo "<li><a href='" . the_permalink() . "'>" . the_title() .
"</a>" .
$post->blog_ID .
$post->post_date .
$post->post_title .
$post->pubtimes .
$post->post_author .
$post->post_content .
$post->post_excerpt .
$post->post_status;
"</li>";
endforeach;
