WordPress.org

Ready to get started?Download WordPress

Forums

Query_posts without a custom field (3 posts)

  1. djhsecondnature
    Member
    Posted 2 years ago #

    I'm trying to select posts without a particular custom field. Some posts will have it, some won't, I want to grab just the ones that do not have it.

    Something like this:

    $args = array(
        'meta_query' => array(
            array(
                'key' => '$customfield',
                'value' => NULL,
                'compare' => '='
                )
             )
          );

    But not that, as that doesn't work.

    Anyone have any ideas?

  2. djhsecondnature
    Member
    Posted 2 years ago #

    *bump*

  3. esmi
    Forum Moderator
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic