Support » Plugins » Hacks » Fetch all post ids of a certain post_type

  • Mario

    (@metalmario)


    Hi,
    i need to extract just the IDs of the posts of a set post_type.
    I currently use :
    query_posts(“post_type=mytype&posts_per_page=-1”) and i iterate through the results to get the IDs…but i need a faster way to directly query the IDs without the overhead of fetching everthing of a post.
    What’s a better way to do that? Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fetch all post ids of a certain post_type’ is closed to new replies.