In the Admin section I'm using quesry posts to get the title and content of a custom post
this query_posts('post_type=sfnewsletter'); will get me the content I need but unfortunately what I need to do now is to pass the ID of the custom post via a form and then retrieve that content
I've tried
query_posts('p=32');
query_posts('page_id=32');
query_posts('page=32');
query_posts('sfnewsletter_id=32');
And not only do I not get the right custom post some of them return a post with an ID of 14 (not the first or last post)
I have confirmed that 32 is the correct ID for the custom post I am trying to get.
THIS IS THE FORM
It passes the ID correctly
<form method="post" action="<?php echo sfn_form_url(); ?>" >
<table class="form-table">
<tr valign="top"><th scope="row"><?php _e( 'To', 'sfnewsletter' ); ?></th>
<td>
<select name="sfnewsletter_to" id="sfnewsletter_to">
<option value="0">Please Choose</option>
<?php wp_dropdown_roles() ?>
</select>
</td>
</tr>
<tr valign="top"><th scope="row"><?php _e( 'Newsletter', 'sfnewsletter' ); ?></th>
<td>
<select name="sfnewsletter_newsletter" id="sfnewsletter_newsletter">
<option value="0">Please Choose</option>
<?php
query_posts('post_type=sfnewsletter');
if (have_posts()) : while (have_posts()) : the_post();
echo '<option value="' .get_the_ID(). '">' .get_the_title(). '</option>';
endwhile; endif;
?>
</select>
</td>
</tr>
</table>
<p class="submit">
<input id="sfnewsletter_hidden" class="regular-text" type="hidden" name="sfnewsletter_hidden" value="<?php esc_attr_e( 'SEND' ); ?>" />
<input type="submit" class="button-primary" value="<?php _e( 'Send Message', 'sfnewsletter' ); ?>" />
</p>
</form>
THIS IS THE SOLUTION I CAME UP WITH. THE ANSWER I HAVE ACCEPTED THE RIGHT WAY TO DO IT THOUGH, MY WAY IS A FUDGE
ok, I have come up with a work around that suits my situation.
Since I don't seem to be able to use my custom post ID in the query I have used the ID from the form and converted it into the permalink and then used that in the query like so
$sfnewsletter_slug = basename( get_permalink($sfnewsletter_newsletter) );
$the_query = new WP_Query( array( 'post_type' =>'sfnewsletter', 'posts_per_page'=>1, 'name'=>$sfnewsletter_slug ) );
This gives me the output I am looking for.