Show specific post-id from a specific post-type

I have a post-type called 'test'.

I'd like to render a specific post from that post-type.

I'm assuming I specify the post's ID to do that.

After some Googling this where I've ended up, but it shows all the posts, not just the Post with an ID of 1.

<?php $loop = new WP_Query( array('post_id' => 1, 'post_type' => 'test', 'posts_per_page' => 10) ); ?>

<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

     <?php the_content(); ?>

 <?php endwhile; ?>

Anyone have any idea? Any help would be greatly appreciated. Thanks!

Answers


For specific post Id variable is p & not post_id, Try this.

$loop = new WP_Query( array('p' => 1, 'post_type' => 'test', 'posts_per_page' => 10) ); 

Need Your Help

Turn html textarea into pdf

html pdf

I have this textarea on my site that users can edit and thus has formatting and spacing. I would like for the user to push a button and generate a pdf of this textarea. This seems like it would be

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.