I’m simply trying to display a specific post id from my custom post type ‘homepage_video’. I’m sure that this is the correct code but it seems to be returning all of the posts rather than just Post Id 40.
<?php
query_posts('post_id=40&post_type=homepage_video');
while (have_posts()): the_post(); ?>
<div id="video-panel-blue">
<?php get_custom_field('home-video-iframe', TRUE); ?>
</div>
<?php endwhile; ?>
Thanks
post_id
is not a valid argument forquery_post
Changepost_id
top
,so you get:
to see the list of arguments you can use with query_posts take a look at this codex entry
All posts, regardless of their post type, are stored in the same table in WordPress. That implies that the post ID is unique. So you don’t have to use
query_posts()
to get a specific post, you can simply useget_post()
: