• Hi – I’m having trouble constructing this query. The idea is to grab a particular post, which also happens to be a custom post. So I’m trying this, but it’s obviously wrong. It just lists all the custom posts. How do I limit to just one particular custom post? Thanks

    <?php query_posts(  array(
    'post_type' => 'columns'
    ),
    'p=32'
    ); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter robahas

    (@robahas)

    FYI, if I just to query_posts (‘p=32’); I get nothing.

    you could try:

    <?php query_posts(  array(
    'post_type' => 'columns',
    'p' => 32 )
    ); ?>

    or:

    <?php query_posts(  array(
    'post_type' => 'columns',
    'post__in' => array(32) )
    ); ?>

    (untested)

    Thread Starter robahas

    (@robahas)

    Thanks alchymyth – No joy on those.

    Thread Starter robahas

    (@robahas)

    Update – I must have done something wrong the first time bc your first suggestion does work. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to query an individual custom post’ is closed to new replies.