• Resolved Nilav

    (@nilav)


    Hi,

    I try to generate a query :

    <?php query_posts(array( ‘post_type’ => array( ‘developer-editor’ ), ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘post__in’ => array($developer_id) ) ); ?><?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Where $developer_id=’9313,9349′

    So, I should see two posts but only first ID is present. But, if I change $developer_id directly by 9313,9349. That’s work ! But I can’t do that in reality. I need to use $developer_id.

    I did an echo on $developer_id to check if it works. It’s ok, I have my two ID : 9313,9349. So, I don’t understand where is my mistake. A bad interpretation of the comma ?

Viewing 1 replies (of 1 total)
  • Thread Starter Nilav

    (@nilav)

    Pfff, That’s work with a explode function

    Results :
    <?php query_posts(array( 'post_type' => array( 'developer-editor' ), 'orderby' => 'title', 'order' => 'ASC', 'post__in' => explode(',',$developer_id), ) ); ?><?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    I will reflect 2 minutes more before to post my problem the next time. 😀

Viewing 1 replies (of 1 total)

The topic ‘Query Posts with custom posts type and post__in’ is closed to new replies.