Wordpress - How to Display Post information using Post ID's

Discussion in 'PHP' started by ridesign, Jun 8, 2009.

  1. #1
    I am running a custom query using a select in a page template, and I have got a list of post id's, how can I get all of the post information for these post's?

    I am trying to use the following:
    <?php if ( function_exists('the_tags') ) { the_tags('Tags: ', ', ', ''); } ?>

    But it is not appearing, also the_title(); does not show the right post.
    Do I need to do setup_postdata? as I could not get it working?
    My query is : $myquery = $wpdb->get_results($hdqry);
     
    ridesign, Jun 8, 2009 IP
  2. Worldwidirectory

    Worldwidirectory Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $wpdb->get_results("SELECT post_title, post_date_gmt... FROM {$wpdb->posts} WHERE ID = XXX");
     
    Worldwidirectory, Jun 8, 2009 IP