Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

post_id is not a valid argument for query_post Change post_id to p, so you get:

query_posts('p=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; ?>

to see the list of arguments you can use with query_posts take a look at this codex entry

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.