If you know the ID
of a post you can get_post
to request the associated information. One thing to keep in mind is that the ID
parameter MUST be a variable. get_post
also takes a second parameter that allows you specify the type of output that you prefer (OBJECT
, ARRAY_A
for associative array, and ARRAY_N
for numeric array).
1 2 3 4 5 6 |
<?php require('wp-blog-header.php'); define('WP_USE_THEMES', false); $post = get_post($dummy_id = 945, 'ARRAY_A'); print_r($post); ?> |