WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get_posts argument meta_key not working (4 posts)

  1. crstauf
    Member
    Posted 2 years ago #

    can anyone suggest why the code below is not working, even tho i have a memo (custom post type) with a meta_key of '_readbestby_date' with a numeric value?

    $posts = get_posts('post_type=any&meta_key=_readbestby_date&numberposts=-1');

  2. crstauf
    Member
    Posted 2 years ago #

    the function containing the code is hooked into the 'init' action

  3. crstauf
    Member
    Posted 2 years ago #

    side note: the 3.3 beta version im running on my local server doesn't handle the query either. both versions seem to handle regular posts just fine, but not custom post types.

  4. crstauf
    Member
    Posted 2 years ago #

    well for anyone else who stumbles onto this:

    it turned out that i was performing the query before my custom post types were being created. changing the priority to a later step fixed my problem.

Topic Closed

This topic has been closed to new replies.

About this Topic